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 2023/12/01 07:05:46 UTC

(incubator-kie-optaplanner-quickstarts) branch 8.x updated: kie-issues#727: define push GH tokens for jenkins

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

jstastnycz pushed a commit to branch 8.x
in repository https://gitbox.apache.org/repos/asf/incubator-kie-optaplanner-quickstarts.git


The following commit(s) were added to refs/heads/8.x by this push:
     new ed51b535 kie-issues#727: define push GH tokens for jenkins
ed51b535 is described below

commit ed51b535234a1bb654cfd1b9cf2244f8ce8af565
Author: jstastny-cz <ja...@ibm.com>
AuthorDate: Tue Nov 28 13:33:35 2023 +0100

    kie-issues#727: define push GH tokens for jenkins
---
 .ci/jenkins/Jenkinsfile.setup-branch | 12 ++++++++----
 .ci/jenkins/dsl/jobs.groovy          |  3 ++-
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/.ci/jenkins/Jenkinsfile.setup-branch b/.ci/jenkins/Jenkinsfile.setup-branch
index 1d50743e..a7e9f31b 100644
--- a/.ci/jenkins/Jenkinsfile.setup-branch
+++ b/.ci/jenkins/Jenkinsfile.setup-branch
@@ -91,7 +91,7 @@ pipeline {
                                 githubscm.findAndStageNotIgnoredFiles('pom.xml') 
                                 githubscm.findAndStageNotIgnoredFiles('build.gradle')
                             })
-                            githubscm.pushObject('origin', getBuildBranch(), getGitAuthorCredsID())
+                            githubscm.pushObject('origin', getBuildBranch(), getGitAuthorPushCredsId())
                         } else {
                             println '[WARN] no changes to commit'
                         }
@@ -124,7 +124,7 @@ void sendErrorNotification() {
 void checkoutRepo(String repository, String branch) {
     dir(repository) {
         deleteDir()
-        checkout(githubscm.resolveRepository(repository, getGitAuthor(), branch, false))
+        checkout(githubscm.resolveRepository(repository, getGitAuthor(), branch, false, getGitAuthorCredsId()))
         // need to manually checkout branch since on a detached branch after checkout command
         sh "git checkout ${branch}"
     }
@@ -147,8 +147,12 @@ String getOptaPlannerVersion() {
     return params.OPTAPLANNER_VERSION
 }
 
-String getGitAuthorCredsID() {
-    return env.AUTHOR_CREDS_ID
+String getGitAuthorCredsId() {
+    return env.GIT_AUTHOR_CREDS_ID
+}
+
+String getGitAuthorPushCredsId() {
+    return env.GIT_AUTHOR_PUSH_CREDS_ID
 }
 
 MavenCommand getMavenCommand(String directory) {
diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy
index 46cc6814..d3ffc361 100644
--- a/.ci/jenkins/dsl/jobs.groovy
+++ b/.ci/jenkins/dsl/jobs.groovy
@@ -66,7 +66,8 @@ void createSetupBranchJob() {
         JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}",
 
         GIT_AUTHOR: "${GIT_AUTHOR_NAME}",
-        AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}",
+        GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}",
+        GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}",
 
         MAVEN_SETTINGS_CONFIG_FILE_ID: "${MAVEN_SETTINGS_FILE_ID}",
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org