Skip to content

Commit

Permalink
NO-ISSUE: Switch to GPG File Jenkins secret (apache#1240)
Browse files Browse the repository at this point in the history
* Switch to GPG File Jenkins secret

* Switch to GPG File Jenkins secret
  • Loading branch information
rodrigonull committed Aug 30, 2024
1 parent 37cafc7 commit e30d4f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .ci/jenkins/config/branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ cloud:
release:
gpg:
sign:
key_credentials_id: GPG_KEY
key_credentials_id: GPG_KEY_FILE
passphrase_credentials_id: ''
svn:
staging_repository: https://dist.apache.org/repos/dist/dev/incubator/kie
Expand Down
8 changes: 2 additions & 6 deletions jenkins-pipeline-shared-libraries/vars/releaseUtils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,10 @@ def gpgImportKeyFromFileWithPassword(String gpgKeyCredentialsId, String gpgKeyPa
}

def gpgImportKeyFromStringWithoutPassword(String gpgKeyCredentialsId) {
withCredentials([string(credentialsId: gpgKeyCredentialsId, variable: 'SIGNING_KEY')]) {
// copy the key to singkey.gpg file in *plain text* so we can import it
withCredentials([file(credentialsId: gpgKeyCredentialsId, variable: 'SIGNING_KEY')]) {
sh """
echo "$SIGNING_KEY" > $WORKSPACE/signkey.gpg
# Please do not remove list keys command. When gpg is run for the first time, it may initialize some internals.
gpg --list-keys
gpg --batch --pinentry-mode=loopback --import $WORKSPACE/signkey.gpg
rm $WORKSPACE/signkey.gpg
gpg --batch --pinentry-mode=loopback --import $SIGNING_KEY
"""
}
}
Expand Down

0 comments on commit e30d4f6

Please sign in to comment.