Add optional package signing

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-11-17 20:14:14 +01:00
parent eb297d90ce
commit 0f0ac05107
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
2 changed files with 8 additions and 2 deletions

View file

@ -14,7 +14,7 @@ RUN set -ex \
/usr/local/bin/dumb-init \
/usr/local/bin/gosu
VOLUME ["/src", "/repo"]
VOLUME ["/src", "/repo", "/config"]
WORKDIR /src
COPY run.sh /usr/local/bin/

8
run.sh
View file

@ -2,6 +2,7 @@
set -euxo pipefail
SRC=${1:-}
MAKEPKG_OPTS=(-cCs --noconfirm --needed)
# Override WORKDIR
cd /src
@ -19,11 +20,16 @@ if [ ! -e PKGBUILD ]; then
cd /src/git
fi
[ -e /config/signing.asc ] && {
gosu builder gpg --import </config/signing.asc
MAKEPKG_OPTS+=(--sign)
}
# Update pacman index
pacman -Sy
# Execute the build itself
gosu builder makepkg -cCs --noconfirm --needed
gosu builder makepkg ${MAKEPKG_OPTS[@]}
PACKAGE=$(ls *.pkg.*) # This should be only one file