diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index 8027ec60f..5483c1486 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -31,7 +31,7 @@ pipeline { JAVA_HOME = "${GRAALVM_HOME}" - BOT_BRANCH_HASH = "${util.generateHash(10)}" + PR_BRANCH_HASH = "${util.generateHash(10)}" // Environment required by OLM tests when run from process OP_TEST_CONTAINER_OPT = '-t' @@ -87,8 +87,7 @@ pipeline { } steps { script { - githubscm.forkRepo(helper.getBotAuthorCredsID()) - githubscm.createBranch(helper.getBotBranch()) + githubscm.createBranch(helper.getPRBranch()) } } } @@ -275,12 +274,12 @@ pipeline { if (gitChanges) { String prMsg = "[${helper.getBuildBranch()}] Update version to ${helper.getProjectVersion()}" def prBody = "Generated by build ${BUILD_TAG}: ${BUILD_URL}.\nPlease do not merge, it shoud be merged automatically." - githubscm.pushObject('origin', helper.getBotBranch(), helper.getBotAuthorCredsID()) - prLink = githubscm.createPR(prMsg, prBody, helper.getBuildBranch(), helper.getBotAuthorCredsID()) + githubscm.pushObject('origin', helper.getPRBranch(), helper.getGitAuthorCredsID()) + prLink = githubscm.createPR(prMsg, prBody, helper.getBuildBranch(), helper.getGitAuthorCredsID()) properties.add("${helper.getRepoName()}.pr.link", prLink) - properties.add("${helper.getRepoName()}.pr.source.uri", "https://github.com/${helper.getBotAuthor()}/${helper.getRepoName()}") - properties.add("${helper.getRepoName()}.pr.source.ref", helper.getBotBranch()) + properties.add("${helper.getRepoName()}.pr.source.uri", "https://github.com/${helper.getGitAuthor()}/${helper.getRepoName()}") + properties.add("${helper.getRepoName()}.pr.source.ref", helper.getPRBranch()) properties.add("${helper.getRepoName()}.pr.target.uri", "https://github.com/${helper.getGitAuthor()}/${helper.getRepoName()}") properties.add("${helper.getRepoName()}.pr.target.ref", helper.getBuildBranch()) } else { diff --git a/.ci/jenkins/Jenkinsfile.examples-images.promote b/.ci/jenkins/Jenkinsfile.examples-images.promote index 30e77e79a..870966f89 100644 --- a/.ci/jenkins/Jenkinsfile.examples-images.promote +++ b/.ci/jenkins/Jenkinsfile.examples-images.promote @@ -17,7 +17,6 @@ pipeline { CONTAINER_ENGINE = 'podman' CONTAINER_TLS_OPTIONS = '--tls-verify=false' - BOT_BRANCH_HASH = "${util.generateHash(10)}" GITHUB_REPO = "${REPO_NAME}" // for github-release cli } @@ -34,7 +33,7 @@ pipeline { steps { script { helper.cleanGoPath() - + helper.updateDisplayName() properties.readFromUrl(helper.getDeployPropertiesFileUrl()) diff --git a/.ci/jenkins/Jenkinsfile.promote b/.ci/jenkins/Jenkinsfile.promote index a81d90f41..7784fb8db 100644 --- a/.ci/jenkins/Jenkinsfile.promote +++ b/.ci/jenkins/Jenkinsfile.promote @@ -19,7 +19,7 @@ pipeline { CONTAINER_ENGINE = 'podman' CONTAINER_TLS_OPTIONS = '--tls-verify=false' - BOT_BRANCH_HASH = "${util.generateHash(10)}" + PR_BRANCH_HASH = "${util.generateHash(10)}" GITHUB_REPO = "${REPO_NAME}" // for github-release cli } @@ -125,10 +125,9 @@ pipeline { String prLink = '' String nextVersion = helper.getNextVersion() String snapshotBranch = helper.getSnapshotBranch() - dir('bot') { + dir('pr') { // Prepare PR helper.checkoutRepo() - githubscm.forkRepo(helper.getBotAuthorCredsID()) githubscm.createBranch(snapshotBranch) // Update version to next snapshot @@ -143,8 +142,8 @@ pipeline { git reset -- go.sum ''' }) - githubscm.pushObject('origin', snapshotBranch, helper.getBotAuthorCredsID()) - prLink = githubscm.createPR(commitMsg, prBody, helper.getBuildBranch(), helper.getBotAuthorCredsID()) + githubscm.pushObject('origin', snapshotBranch, helper.getGitAuthorCredsID()) + prLink = githubscm.createPR(commitMsg, prBody, helper.getBuildBranch(), helper.getGitAuthorCredsID()) } dir(helper.getRepoName()) { if (prLink) { diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy index 2cbcb1a8c..0abcf9471 100644 --- a/.ci/jenkins/dsl/jobs.groovy +++ b/.ci/jenkins/dsl/jobs.groovy @@ -114,8 +114,6 @@ void setupDeployJob(JobType jobType, String envName = '') { AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}", GITHUB_TOKEN_CREDS_ID: "${GIT_AUTHOR_TOKEN_CREDENTIALS_ID}", - GIT_AUTHOR_BOT: "${GIT_BOT_AUTHOR_NAME}", - BOT_CREDENTIALS_ID: "${GIT_BOT_AUTHOR_CREDENTIALS_ID}", DEFAULT_STAGING_REPOSITORY: "${MAVEN_NEXUS_STAGING_PROFILE_URL}", MAVEN_ARTIFACT_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}", @@ -191,8 +189,6 @@ void setupPromoteJob(JobType jobType) { AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}", GITHUB_TOKEN_CREDS_ID: "${GIT_AUTHOR_TOKEN_CREDENTIALS_ID}", - GIT_AUTHOR_BOT: "${GIT_BOT_AUTHOR_NAME}", - BOT_CREDENTIALS_ID: "${GIT_BOT_AUTHOR_CREDENTIALS_ID}", ]) KogitoJobTemplate.createPipelineJob(this, jobParams)?.with { parameters { diff --git a/.ci/jenkins/scripts/helper.groovy b/.ci/jenkins/scripts/helper.groovy index df3a42181..07c184dae 100644 --- a/.ci/jenkins/scripts/helper.groovy +++ b/.ci/jenkins/scripts/helper.groovy @@ -258,16 +258,8 @@ String getGitAuthorCredsID() { return env.AUTHOR_CREDS_ID } -String getBotBranch() { - return "${getProjectVersion()}-${env.BOT_BRANCH_HASH}" -} - -String getBotAuthor() { - return env.GIT_AUTHOR_BOT -} - -String getBotAuthorCredsID() { - return env.BOT_CREDENTIALS_ID +String getPRBranch() { + return "${getProjectVersion()}-${env.PR_BRANCH_HASH}" } String getProjectVersion() { @@ -279,7 +271,7 @@ String getNextVersion() { } String getSnapshotBranch() { - return "${getNextVersion()}-${env.BOT_BRANCH_HASH}" + return "${getNextVersion()}-${env.PR_BRANCH_HASH}" } boolean shouldLaunchTests() {