This is an automated email from the ASF dual-hosted git repository.

rantunes pushed a commit to branch 10.0.x
in repository 
https://gitbox.apache.org/repos/asf/incubator-kie-kogito-pipelines.git


The following commit(s) were added to refs/heads/10.0.x by this push:
     new af256adb NO-ISSUE: Switch to GPG File Jenkins secret (#1240)
af256adb is described below

commit af256adb1c40364bda525aebef0642600eee67c0
Author: Rodrigo Antunes <[email protected]>
AuthorDate: Wed Aug 14 09:00:30 2024 -0300

    NO-ISSUE: Switch to GPG File Jenkins secret (#1240)
    
    * Switch to GPG File Jenkins secret
    
    * Switch to GPG File Jenkins secret
---
 .ci/jenkins/config/branch.yaml                             | 2 +-
 jenkins-pipeline-shared-libraries/vars/releaseUtils.groovy | 8 ++------
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/.ci/jenkins/config/branch.yaml b/.ci/jenkins/config/branch.yaml
index d73cee1d..618b298f 100644
--- a/.ci/jenkins/config/branch.yaml
+++ b/.ci/jenkins/config/branch.yaml
@@ -87,7 +87,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
diff --git a/jenkins-pipeline-shared-libraries/vars/releaseUtils.groovy 
b/jenkins-pipeline-shared-libraries/vars/releaseUtils.groovy
index 6e883375..af51530b 100644
--- a/jenkins-pipeline-shared-libraries/vars/releaseUtils.groovy
+++ b/jenkins-pipeline-shared-libraries/vars/releaseUtils.groovy
@@ -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
         """
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to