30
makepkg-ci
Executable file
30
makepkg-ci
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
shopt -s nullglob
|
||||
|
||||
did="pkg-build-$$.$SRANDOM"
|
||||
mkdir "/tmp/$did"
|
||||
|
||||
pkg_dest=$1
|
||||
pkg_url=$2
|
||||
|
||||
#podman run --userns=keep-id -u root --rm -v "/tmp/$did:/buildroot" "spark:autobuilder" /build
|
||||
git clone "$pkg_url" "/tmp/$did"
|
||||
cd "/tmp/$did"
|
||||
makepkg-podman 'localhost/spark:autobuilder'
|
||||
|
||||
artifacts=( "/tmp/$did/"*.pkg.* )
|
||||
for i in "${artifacts[@]}"; do
|
||||
i_name="${i##*/}"
|
||||
|
||||
printf 'Found artifact: %s\n' "$i_name"
|
||||
|
||||
if [[ -f "$pkg_dest/$i_name" ]]; then
|
||||
printf '%s/%s already exists, not overwriting.\n' "$pkg_dest" "$i_name"
|
||||
else
|
||||
printf 'Copying %s to %s.\n' "$i_name" "$pkg_dest"
|
||||
cp -vn "$i" "$pkg_dest"
|
||||
fi
|
||||
done
|
||||
|
||||
# cleanup
|
||||
rm -rf "/tmp/$did"
|
Reference in New Issue
Block a user