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/dumb-init \
/usr/local/bin/gosu /usr/local/bin/gosu
VOLUME ["/src", "/repo"] VOLUME ["/src", "/repo", "/config"]
WORKDIR /src WORKDIR /src
COPY run.sh /usr/local/bin/ COPY run.sh /usr/local/bin/

8
run.sh
View file

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