Obtain PGP keys before update

This commit is contained in:
Tobias Manske 2023-04-07 12:27:15 +02:00
parent 2c00ff0a4c
commit 17ce46cc12
Signed by: tobias
GPG Key ID: 9164B527694A0709

View File

@ -19,13 +19,16 @@ mcli alias set s3 https://s3.tobiasmanske.de "${REPO_ACCESS_KEY}" "${REPO_SECRET
LOCK=""
while [[ "${LOCK}" != "${PIPELINE_ID}" ]]; do
if [[ ${DEBUG} == "true" ]]; then
echo "Debug mode, not waiting for lock"
break
fi
LOCK=$(mcli cat s3/repo/LOCK)
if [[ "${LOCK}" == "FREE" ]]; then
echo $PIPELINE_ID | mcli pipe s3/repo/LOCK
fi
echo "Waiting for lock with id $PIPELINE_ID..."
sleep $((RANDOM % 10))
done
unlock() {
@ -57,7 +60,7 @@ gpg --import --batch trustroot.asc
sudo pacman-key --lsign 10BE06BC275CE0E17373B368F67996C486D1B56B
# Setup signing
echo "${BUILD_GPG_KEY:-}" | base64 -d | gpg --import --batch
echo "${BUILD_GPG_KEY}" | base64 -d | gpg --import --batch
echo "C3FE87CFB8F8D503AE03EC1C033E7F3DC71FE89E:6:" | gpg --import-ownertrust --batch
@ -104,12 +107,19 @@ comm -23 <(cut -f1 vcs | sort) <(pacman -Slq "${AUR_REPO_NAME}" | sort) | tee -a
# Build all packages defined in buildqueue
while read -r i; do
cat "$i"/.SRCINFO
done <buildqueue | aur graph | tsort | tac >queue
done <buildqueue | tee buildfile | aur graph | tsort | tac >queue
grep validpgpkeys buildfile | cut -d "=" -f2 | tr -d " " | xargs -n1 gpg --recv-keys
echo
echo QUEUE
echo
cat queue
if [[ ${DEBUG} == "true" ]]; then
echo "Debug mode, not building anything."
exit 0
fi
if wc -l queue | grep -q "^0 "; then
echo "Nothing to build, exiting."
exit 0