Skip to content

Commit

Permalink
KOGITO-9671 CI: Remove bot account usage (apache#5434)
Browse files Browse the repository at this point in the history
  • Loading branch information
radtriste committed Aug 2, 2023
1 parent ddae723 commit d02808b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 17 deletions.
8 changes: 2 additions & 6 deletions .ci/jenkins/Jenkinsfile.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pipeline {
steps {
script {
dir(getRepoName()) {
prepareForPR()
githubscm.createBranch(getPRBranch())
}
}
}
Expand Down Expand Up @@ -162,7 +162,7 @@ pipeline {
success {
script {
setDeployPropertyIfNeeded("${getRepoName()}.pr.source.uri", "https://github.com/${getGitAuthor()}/${getRepoName()}")
setDeployPropertyIfNeeded("${getRepoName()}.pr.source.ref", getBuildBranch())
setDeployPropertyIfNeeded("${getRepoName()}.pr.source.ref", getPRBranch())
setDeployPropertyIfNeeded("${getRepoName()}.pr.target.uri", "https://github.com/${getGitAuthor()}/${getRepoName()}")
setDeployPropertyIfNeeded("${getRepoName()}.pr.target.ref", getBuildBranch())
}
Expand Down Expand Up @@ -200,10 +200,6 @@ void checkoutRepo() {
sh "git checkout ${getBuildBranch()}"
}

void prepareForPR() {
githubscm.createBranch(getPRBranch())
}

void commitAndCreatePR() {
def commitMsg = "[${getBuildBranch()}] Update version to ${getProjectVersion()}"
def prBody = "Generated by build ${BUILD_TAG}: ${BUILD_URL}.\nPlease do not merge, it should be merged automatically."
Expand Down
8 changes: 2 additions & 6 deletions .ci/jenkins/Jenkinsfile.promote
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ pipeline {
steps {
script {
dir('pr') {
prepareForPR()
checkoutRepo()
githubscm.createBranch(getSnapshotBranch())

maven.mvnVersionsSet(getMavenCommand(), getSnapshotVersion(), true)

Expand Down Expand Up @@ -242,11 +243,6 @@ void tagLatest() {
}
}

void prepareForPR() {
checkoutRepo()
githubscm.createBranch(getSnapshotBranch())
}

void commitAndCreatePR() {
def commitMsg = "[${getBuildBranch()}] Update project version to ${getSnapshotVersion()}"
def prBody = "Generated by build ${BUILD_TAG}: ${BUILD_URL}.\nPlease do not merge, it should be merged automatically."
Expand Down
3 changes: 0 additions & 3 deletions .ci/jenkins/config/branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ git:
name: kiegroup
credentials_id: kie-ci4
token_credentials_id: kie-ci4-token
bot_author:
name: bsig-gh-bot
credentials_id: bsig-gh-bot
fork_author:
name: kie-ci
credentials_id: kie-ci
Expand Down
4 changes: 2 additions & 2 deletions .ci/jenkins/project/Jenkinsfile.post-release
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pipeline {

DROOLS_CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}")

BOT_BRANCH_HASH = "${util.generateHash(10)}"
PR_BRANCH_HASH = "${util.generateHash(10)}"
}

stages {
Expand All @@ -46,7 +46,7 @@ pipeline {
script {
String droolsWebsiteRepository = 'drools-website'
String prLink = null
String prBranchName = "${getProjectVersion().toLowerCase()}-${env.BOT_BRANCH_HASH}"
String prBranchName = "${getProjectVersion().toLowerCase()}-${env.PR_BRANCH_HASH}"
dir(droolsWebsiteRepository) {
checkoutRepo(droolsWebsiteRepository, getBuildBranch()) // there is no other branch
githubscm.createBranch(prBranchName)
Expand Down

0 comments on commit d02808b

Please sign in to comment.