Skip to content

Commit

Permalink
KOGITO-5386: added a new parameter for unique branch name (#1666)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbiarnes authored Aug 8, 2023
1 parent d3dabae commit 217642d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .ci/jenkins/Jenkinsfile.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ pipeline {
environment {
KOGITO_CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}")

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

OPENSHIFT_REGISTRY = credentials('OPENSHIFT_REGISTRY')
}

Expand Down Expand Up @@ -67,6 +65,9 @@ pipeline {
}
steps {
script {
if (githubscm.isBranchExist('origin',getPRBranch())) {
githubscm.removeRemoteBranch('origin', getPRBranch())
}
githubscm.createBranch(getPRBranch())
}
}
Expand Down Expand Up @@ -395,7 +396,7 @@ String getGitAuthorCredsID() {
}

String getPRBranch() {
return "${getProjectVersion() ?: getBuildBranch()}-${env.PR_BRANCH_HASH}"
return params.KOGITO_PR_BRANCH
}

String getProjectVersion() {
Expand Down
1 change: 1 addition & 0 deletions .ci/jenkins/dsl/jobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ void setupDeployJob(JobType jobType, String envName = '') {
stringParam('QUARKUS_PLATFORM_VERSION', '', 'Allow to override the Quarkus Platform version')
}

stringParam('KOGITO_PR_BRANCH', '', 'PR branch name')
booleanParam('SEND_NOTIFICATION', false, 'In case you want the pipeline to send a notification on CI channel for this run.')
}
}
Expand Down

0 comments on commit 217642d

Please sign in to comment.