forked from Spark/builder
this is a bit simpler
Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
parent
1f2b2e3c6d
commit
cba181007b
|
@ -8,10 +8,11 @@ export PKG_URL=$1
|
||||||
# Upgrade
|
# Upgrade
|
||||||
pacman -Suy --noconfirm
|
pacman -Suy --noconfirm
|
||||||
|
|
||||||
|
# gnupg dir permissions
|
||||||
|
chown -R "$BUILDUSER:$BUILDUSER" /.gnupg
|
||||||
|
|
||||||
# Workdir
|
# Workdir
|
||||||
chown -R builder:builder /.gnupg
|
|
||||||
cd /buildroot
|
cd /buildroot
|
||||||
|
|
||||||
# Build the damn thing
|
# Build the damn thing
|
||||||
sudo -u builder git clone "$PKG_URL" .
|
sudo -u "$BUILDUSER" GNUPGHOME="/.gnupg" makepkg -s --noconfirm -L
|
||||||
sudo -u builder GNUPGHOME="/.gnupg" makepkg -s --noconfirm -L
|
|
||||||
|
|
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"
|
|
@ -1,27 +1,16 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
shopt -s nullglob
|
|
||||||
|
|
||||||
did="pkg-build-$$.$SRANDOM"
|
image=${1:-localhost/spark:autobuilder}
|
||||||
mkdir "/tmp/$did"
|
|
||||||
|
|
||||||
pkg_dest=$1
|
podman_cmd=(
|
||||||
pkg_url=$2
|
podman run --rm -u root
|
||||||
|
--userns=keep-id
|
||||||
|
-v "$PWD:/buildroot"
|
||||||
|
--workdir /buildroot
|
||||||
|
--name "autobuilder.$$"
|
||||||
|
--env "BUILDUSER=$USER"
|
||||||
|
--entrypoint /build
|
||||||
|
"$image"
|
||||||
|
)
|
||||||
|
|
||||||
podman run --userns=keep-id -u root --rm -v "/tmp/$did:/buildroot" "spark:autobuilder" /build "$pkg_url"
|
"${podman_cmd[@]}"
|
||||||
|
|
||||||
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"
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
err() { printf '%s\n' "$*" >&2; }
|
err() { printf '%s\n' "$*" >&2; }
|
||||||
|
|
||||||
build_remote() { makepkg-podman "$@"; }
|
build_remote() { makepkg-ci "$@"; }
|
||||||
cleanup() { rm -f "$lockfile"; }
|
cleanup() { rm -f "$lockfile"; }
|
||||||
|
|
||||||
lock() {
|
lock() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user