diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index a9e4f41ed6..ae4e75a976 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -80,6 +80,9 @@ pipeline { } steps { dir(getRepoName()) { + if (githubscm.isBranchExist('origin',getPRBranch())) { + githubscm.removeRemoteBranch('origin', getPRBranch()) + } githubscm.createBranch(getPRBranch()) } } @@ -265,7 +268,7 @@ String getProjectVersion() { } String getPRBranch() { - return "${getProjectVersion()}-${env.PR_BRANCH_HASH}" + return params.KOGITO_PR_BRANCH } void setDeployPropertyIfNeeded(String key, def value) { diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy index 8f343d1ba3..19c640537c 100644 --- a/.ci/jenkins/dsl/jobs.groovy +++ b/.ci/jenkins/dsl/jobs.groovy @@ -231,6 +231,7 @@ void setupDeployJob(JobType jobType, String envName = '') { booleanParam('CREATE_PR', false, 'Should we create a PR with the changes ?') stringParam('PROJECT_VERSION', '', 'Optional if not RELEASE. If RELEASE, cannot be empty.') + 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.') }