work with no keep-id

Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
Jack L. Frost 2021-10-06 10:57:26 +03:00
parent 8adeef05bc
commit 0a31377fcd
2 changed files with 10 additions and 4 deletions

View File

@ -3,14 +3,21 @@
# Upgrade
pacman -Suy --noconfirm
# Create a builder user
groupadd -g 1100 builder
useradd -g 1100 -u 1100 builder
# gnupg dir permissions
chown -R "$BUILDUSER:$BUILDUSER" /.gnupg
chown -R builder:builder /.gnupg /buildroot
# Add sudo permissions for pacman to install dependencies
printf '%s ALL=(ALL) NOPASSWD: /usr/bin/pacman\n' "$BUILDUSER" > /etc/sudoers.d/builduser
printf '%s ALL=(ALL) NOPASSWD: /usr/bin/pacman\n' builder > /etc/sudoers.d/builduser
# Workdir
cd /buildroot
# Build the damn thing
sudo -u "$BUILDUSER" GNUPGHOME="/.gnupg" makepkg "$@"
sudo -u builder GNUPGHOME="/.gnupg" makepkg "$@"
# Return the permissions
chown -R root:root /buildroot

View File

@ -4,7 +4,6 @@ image=${PODMAN_IMAGE:-localhost/spark:autobuilder}
podman_cmd=(
podman run --rm -it -u root
--userns=keep-id
-v "$PWD:/buildroot"
--workdir /buildroot
--name "autobuilder.$$"