Skip to content

Commit 9564573

Browse files
committed
Fail-fast the release process if the PGP key is unable to sign
The execution of the Gerrit release process is conditioned on the success of the PGP signature. Fail immediately upon release if the key and passphrase do not allow to perform a digital signature, so that the process fails immediately. Change-Id: Id23cf54b1e87a1078a4e02718151202f04e4a3d0
1 parent acd23af commit 9564573

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

jenkins-docker/agent-release/gerrit-release.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ then
8484
export GPG_PASSPHRASE_FILE="$HOME/.gnupg/gpg-passphrase"
8585
echo '$GPG_PASSPHRASE' | envsubst '$GPG_PASSPHRASE' > $GPG_PASSPHRASE_FILE
8686
git config --global gpg.program /usr/local/bin/gpg-loopback
87+
88+
89+
echo "Testing if GPG signature works"
90+
echo foo > /tmp/foo
91+
/usr/local/bin/gpg-loopback --sign /tmp/foo && /usr/local/bin/gpg-loopback --verify /tmp/foo.gpg
8792
fi
8893

8994
GPG_USER=$(gpg -K --with-colons | grep uid | cut -d ':' -f 10)

0 commit comments

Comments
 (0)