Add key retrieval

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2019-04-04 18:09:42 +02:00
parent ffe6c7e437
commit fe09c47717
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
3 changed files with 20 additions and 0 deletions

View file

@ -18,5 +18,6 @@ VOLUME ["/src", "/repo", "/config"]
WORKDIR /src
COPY run.sh /usr/local/bin/
COPY getkeys.sh /usr/local/bin/
ENTRYPOINT ["/usr/local/bin/run.sh"]

16
getkeys.sh Executable file
View file

@ -0,0 +1,16 @@
#!/bin/bash
set -euo pipefail
[ -f "PKGBUILD" ] || {
echo "No PKGBUILD file found"
exit 1
}
source PKGBUILD
[ -n "${validgpgkeys:-}" ] || {
echo "No 'validgpgkeys' directive found, nothing to do"
exit 0
}
exec gpg --recv-keys "${validgpgkeys[@]}"

3
run.sh
View file

@ -30,6 +30,9 @@ fi
# Update pacman index
pacman -Sy
# Retrieve GPG keys if required
gosu builder getkeys.sh
# Execute the build itself
gosu builder makepkg ${MAKEPKG_OPTS[@]}