You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by js...@apache.org on 2024/06/20 12:00:50 UTC

(incubator-kie-kogito-pipelines) branch main updated: NO-ISSUE: fix buildchain for native build (#1210)

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 <st...@gmail.com>
AuthorDate: Thu Jun 20 14:00:45 2024 +0200

    NO-ISSUE: fix buildchain for native build (#1210)
    
    Co-authored-by: jstastny-cz <ja...@ibm.com>
---
 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: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org