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-docs.git
The following commit(s) were added to refs/heads/main by this push:
new 9833dd0b4 kie-issues#767: set user config for git (#524)
9833dd0b4 is described below
commit 9833dd0b4da9bd6dd7178ba095b79317b371f24b
Author: Jan Stastny <[email protected]>
AuthorDate: Thu Dec 14 12:13:51 2023 +0100
kie-issues#767: set user config for git (#524)
Co-authored-by: jstastny-cz <[email protected]>
---
.ci/jenkins/Jenkinsfile.post-release | 14 +++++++++-----
.ci/jenkins/Jenkinsfile.setup-branch | 18 ++++++++++++------
.ci/jenkins/dsl/jobs.groovy | 8 ++++++--
3 files changed, 27 insertions(+), 13 deletions(-)
diff --git a/.ci/jenkins/Jenkinsfile.post-release
b/.ci/jenkins/Jenkinsfile.post-release
index f10353894..203c401e6 100644
--- a/.ci/jenkins/Jenkinsfile.post-release
+++ b/.ci/jenkins/Jenkinsfile.post-release
@@ -57,7 +57,7 @@ pipeline {
script {
dir("kogito-docs-${getBuildBranch()}") {
deleteDir()
-
checkout(githubscm.resolveRepository('incubator-kie-kogito-docs',
getGitAuthor(), getBuildBranch(), false, getGitAuthorCredsID()))
+
checkout(githubscm.resolveRepository('incubator-kie-kogito-docs',
getGitAuthor(), getBuildBranch(), false, getGitAuthorCredsId()))
sh "git checkout ${getBuildBranch()}"
String antoraFile = 'serverlessworkflow/antora.yml'
@@ -70,14 +70,15 @@ pipeline {
// Add changed files, commit, open and merge PR
if (githubscm.isThereAnyChanges()) {
+
githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId())
githubscm.commitChanges("Release Kogito
${getKogitoVersion()}")
- githubscm.pushObject('origin', getBuildBranch(),
getGitAuthorCredsID())
+ githubscm.pushObject('origin', getBuildBranch(),
getGitAuthorPushCredsId())
} else {
echo "No changes to push."
}
// Tag repository
- githubscm.tagLocalAndRemoteRepository('origin',
getKogitoVersion(), getGitAuthorCredsID(), env.BUILD_TAG, true)
+ githubscm.tagLocalAndRemoteRepository('origin',
getKogitoVersion(), getGitAuthorCredsId(), env.BUILD_TAG, true)
}
}
}
@@ -125,6 +126,9 @@ String getGitAuthor() {
return env.GIT_AUTHOR
}
-String getGitAuthorCredsID() {
- return env.AUTHOR_CREDS_ID
+String getGitAuthorCredsId() {
+ return env.GIT_AUTHOR_CREDS_ID
+}
+String getGitAuthorPushCredsId() {
+ return env.GIT_AUTHOR_PUSH_CREDS_ID
}
diff --git a/.ci/jenkins/Jenkinsfile.setup-branch
b/.ci/jenkins/Jenkinsfile.setup-branch
index 280d32452..889f5f87b 100644
--- a/.ci/jenkins/Jenkinsfile.setup-branch
+++ b/.ci/jenkins/Jenkinsfile.setup-branch
@@ -60,7 +60,7 @@ pipeline {
dir("kogito-docs-${getBuildBranch()}") {
deleteDir()
-
checkout(githubscm.resolveRepository('incubator-kie-kogito-docs',
getGitAuthor(), getBuildBranch(), false, getGitAuthorCredsID()))
+
checkout(githubscm.resolveRepository('incubator-kie-kogito-docs',
getGitAuthor(), getBuildBranch(), false, getGitAuthorCredsId()))
sh "git checkout ${getBuildBranch()}"
String[] branchSplit = getBuildBranch().split("\\.")
@@ -81,8 +81,9 @@ pipeline {
// Add changed files, commit, open and merge PR
if (githubscm.isThereAnyChanges()) {
+
githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId())
githubscm.commitChanges("Init ${getBuildBranch()}
branch")
- githubscm.pushObject('origin', getBuildBranch(),
getGitAuthorCredsID())
+ githubscm.pushObject('origin', getBuildBranch(),
getGitAuthorPushCredsId())
} else {
echo 'No changes to push.'
}
@@ -96,7 +97,7 @@ pipeline {
script {
dir('kogito-docs') {
deleteDir()
-
checkout(githubscm.resolveRepository('incubator-kie-kogito-docs',
getGitAuthor(), 'main', false, getGitAuthorCredsID()))
+
checkout(githubscm.resolveRepository('incubator-kie-kogito-docs',
getGitAuthor(), 'main', false, getGitAuthorCredsId()))
sh 'git checkout main'
updateYaml('antora-playbook.yml') { antoraConfig ->
@@ -110,8 +111,9 @@ pipeline {
// Add changed files, commit, open and merge PR
if (githubscm.isThereAnyChanges()) {
+
githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId())
githubscm.commitChanges("Add branch
${getBuildBranch()} for generation")
- githubscm.pushObject('origin', 'main',
getGitAuthorCredsID())
+ githubscm.pushObject('origin', 'main',
getGitAuthorPushCredsId())
} else {
echo 'No changes to push.'
}
@@ -152,8 +154,12 @@ String getGitAuthor() {
return env.GIT_AUTHOR
}
-String getGitAuthorCredsID() {
- return env.AUTHOR_CREDS_ID
+String getGitAuthorCredsId() {
+ return env.GIT_AUTHOR_CREDS_ID
+}
+
+String getGitAuthorPushCredsId() {
+ return env.GIT_AUTHOR_PUSH_CREDS_ID
}
void updateYaml(String filePath, Closure updateClosure) {
diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy
index fec5bb77a..85d116706 100644
--- a/.ci/jenkins/dsl/jobs.groovy
+++ b/.ci/jenkins/dsl/jobs.groovy
@@ -58,7 +58,9 @@ void createSetupBranchJob() {
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}",
IS_MAIN_BRANCH: "${Utils.isMainBranch(this)}"
])
@@ -80,7 +82,9 @@ void setupPostReleaseJob() {
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}",
])
KogitoJobTemplate.createPipelineJob(this, jobParams)?.with {
parameters {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]