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

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


The following commit(s) were added to refs/heads/main by this push:
     new 34de22bf NO-ISSUE: fix buildchain for native build (#1210)
34de22bf is described below

commit 34de22bf8a9bdf7381781a77506cb94484b878f2
Author: Jan Stastny <[email protected]>
AuthorDate: Thu Jun 20 14:00:45 2024 +0200

    NO-ISSUE: fix buildchain for native build (#1210)
    
    Co-authored-by: jstastny-cz <[email protected]>
---
 dsl/seed/jenkinsfiles/Jenkinsfile.buildchain | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/dsl/seed/jenkinsfiles/Jenkinsfile.buildchain 
b/dsl/seed/jenkinsfiles/Jenkinsfile.buildchain
index e8a9b3c4..54918b58 100644
--- a/dsl/seed/jenkinsfiles/Jenkinsfile.buildchain
+++ b/dsl/seed/jenkinsfiles/Jenkinsfile.buildchain
@@ -101,12 +101,7 @@ pipeline {
                         script {
                             env.BUILD_MVN_OPTS_CURRENT = 
"${env.BUILD_MVN_OPTS_CURRENT ?: ''} ${getBuildMavenOptsCurrent()}"
                             echo "BUILD_MVN_OPTS_CURRENT = 
${BUILD_MVN_OPTS_CURRENT}"
-                            withCredentials([usernamePassword(credentialsId: 
mavenDeployRepositoryCredsId, usernameVariable: 'REPOSITORY_USER', 
passwordVariable: 'REPOSITORY_TOKEN')]) {
-                                if (mavenDeployArtifacts) {
-                                    env.DEPLOY_MVN_OPTS = 
"${env.DEPLOY_MVN_OPTS ?: ''} -DdeployAtEnd 
-Dapache.repository.username=${REPOSITORY_USER} 
-Dapache.repository.password=${REPOSITORY_TOKEN} -DretryFailedDeploymentCount=5"
-                                    echo "DEPLOY_MVN_OPTS = ${DEPLOY_MVN_OPTS}"
-                                }
-
+                            Closure buildchainCommandClosure = {
                                 configFileProvider([configFile(fileId: 
settingsXmlId, variable: 'MAVEN_SETTINGS_FILE')]) {
                                     withCredentials([string(credentialsId: 
"${BUILDCHAIN_CONFIG_GIT_TOKEN_CREDENTIALS_ID}", variable: 'GITHUB_TOKEN')]) {
                                         env.BUILD_MVN_OPTS = 
"${env.BUILD_MVN_OPTS ?: ''} -s ${MAVEN_SETTINGS_FILE} 
-Dmaven.wagon.http.ssl.insecure=true -Dmaven.test.failure.ignore=true"
@@ -116,6 +111,16 @@ pipeline {
                                     }
                                 }
                             }
+                            if (mavenDeployArtifacts) {
+                                
withCredentials([usernamePassword(credentialsId: mavenDeployRepositoryCredsId, 
usernameVariable: 'REPOSITORY_USER', passwordVariable: 'REPOSITORY_TOKEN')]) {
+                                    env.DEPLOY_MVN_OPTS = 
"${env.DEPLOY_MVN_OPTS ?: ''} -DdeployAtEnd 
-Dapache.repository.username=${REPOSITORY_USER} 
-Dapache.repository.password=${REPOSITORY_TOKEN} -DretryFailedDeploymentCount=5"
+                                    echo "DEPLOY_MVN_OPTS = ${DEPLOY_MVN_OPTS}"
+                                    // for buildchain not to leak credentials 
this needs to stay in withCredentials scope
+                                    buildchainCommandClosure()
+                                }
+                            } else {
+                                buildchainCommandClosure()
+                            }
                         }
                     }
                     post {


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

Reply via email to