Skip to content

Commit 40e9417

Browse files
committed
[Build] Secure simplified PGP signing in PR verification builds
1 parent 1dd211b commit 40e9417

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Jenkinsfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,18 @@ pipeline {
2020
}
2121
stage('Build') {
2222
steps {
23-
withCredentials([file(credentialsId: 'secret-subkeys.asc', variable: 'KEYRING'),string(credentialsId: 'gpg-passphrase', variable: 'KEYRING_PASSPHRASE')]) {
23+
withCredentials([
24+
file(credentialsId: 'secret-subkeys.asc', variable: 'KEYRING'),
25+
string(credentialsId: 'gpg-passphrase', variable: 'KEYRING_PASSPHRASE')
26+
]) {
2427
xvnc(useXauthority: true) {
2528
sh '''
2629
mavenArgs="clean verify --batch-mode -Dmaven.test.error.ignore=true -Dmaven.test.failure.ignore=true -Dtycho.p2.baselineMode=failCommon"
2730
if [[ ${BRANCH_NAME} == master ]] || [[ ${BRANCH_NAME} =~ m2e-[0-9]+\\.[0-9]+\\.x ]]; then
2831
mvn ${mavenArgs} -Peclipse-sign,its -DDtycho.pgp.signer.bc.secretKeys="${KEYRING}" -Dgpg.passphrase="${KEYRING_PASSPHRASE}"
2932
else
30-
# Clear KEYRING_PASSPHRASE environment variable
33+
# Clear signing environment variables for PRs
34+
export KEYRING='EMPTY'
3135
export KEYRING_PASSPHRASE='EMPTY'
3236
mvn ${mavenArgs} -Pits
3337
fi

0 commit comments

Comments
 (0)