Skip to content

Commit

Permalink
switch credentials type
Browse files Browse the repository at this point in the history
  • Loading branch information
jstastny-cz committed May 24, 2024
1 parent 49b2409 commit 15c832f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jenkins-pipeline-shared-libraries/vars/release.groovy
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
def gpgImportKeyFromFileWithPassword(String gpgKeyCredentialsId, String gpgKeyPasswordCredentialsId) {
withCredentials([file(credentialsId: gpgKeyCredentialsId, variable: 'SIGNING_KEY')]) {
withCredentials([file(credentialsId: gpgKeyPasswordCredentialsId, variable: 'SIGNING_KEY_PASSWORD')]) {
withCredentials([string(credentialsId: gpgKeyPasswordCredentialsId, variable: 'SIGNING_KEY_PASSWORD')]) {
// copy the key to singkey.gpg file in *plain text* so we can import it
sh """
cat $SIGNING_KEY > $WORKSPACE/signkey.gpg
Expand All @@ -14,7 +14,7 @@ def gpgImportKeyFromFileWithPassword(String gpgKeyCredentialsId, String gpgKeyPa
}

def gpgSignFileDetachedSignatureWithPassword(String file, String signatureTarget, String gpgKeyPasswordCredentialsId) {
withCredentials([file(credentialsId: gpgKeyPasswordCredentialsId, variable: 'SIGNING_KEY_PASSWORD')]) {
withCredentials([string(credentialsId: gpgKeyPasswordCredentialsId, variable: 'SIGNING_KEY_PASSWORD')]) {
sh "gpg --batch --sign --pinentry-mode=loopback --passphrase \"${SIGNING_KEY_PASSWORD}\" --output ${signatureTarget} --detach-sig ${file}"
}
}
Expand Down

0 comments on commit 15c832f

Please sign in to comment.