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="" LOCK=""
while [[ "${LOCK}" != "${PIPELINE_ID}" ]]; do while [[ "${LOCK}" != "${PIPELINE_ID}" ]]; do
if [[ ${DEBUG} == "true" ]]; then
echo "Debug mode, not waiting for lock"
break
fi
LOCK=$(mcli cat s3/repo/LOCK) LOCK=$(mcli cat s3/repo/LOCK)
if [[ "${LOCK}" == "FREE" ]]; then if [[ "${LOCK}" == "FREE" ]]; then
echo $PIPELINE_ID | mcli pipe s3/repo/LOCK echo $PIPELINE_ID | mcli pipe s3/repo/LOCK
fi fi
echo "Waiting for lock with id $PIPELINE_ID..." echo "Waiting for lock with id $PIPELINE_ID..."
sleep $((RANDOM % 10)) sleep $((RANDOM % 10))
done done
unlock() { unlock() {
@ -57,7 +60,7 @@ gpg --import --batch trustroot.asc
sudo pacman-key --lsign 10BE06BC275CE0E17373B368F67996C486D1B56B sudo pacman-key --lsign 10BE06BC275CE0E17373B368F67996C486D1B56B
# Setup signing # 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 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 # Build all packages defined in buildqueue
while read -r i; do while read -r i; do
cat "$i"/.SRCINFO 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
echo QUEUE echo QUEUE
echo echo
cat queue cat queue
if [[ ${DEBUG} == "true" ]]; then
echo "Debug mode, not building anything."
exit 0
fi
if wc -l queue | grep -q "^0 "; then if wc -l queue | grep -q "^0 "; then
echo "Nothing to build, exiting." echo "Nothing to build, exiting."
exit 0 exit 0