diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index 2b73e1d631..40ede679f4 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -86,7 +86,10 @@ pipeline { } steps { dir(getRepoName()) { - prepareForPR() + if (githubscm.isBranchExist('origin',getPRBranch())) { + githubscm.removeRemoteBranch('origin', getPRBranch()) + } + githubscm.createBranch(getPRBranch()) } } } @@ -295,7 +298,7 @@ String getDroolsVersion() { } String getPRBranch() { - return "${getProjectVersion()}-${env.PR_BRANCH_HASH}" + return params.KOGITO_PR_BRANCH } String getGitAuthorCredsID() { diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy index 989d774d1d..0aaac92c96 100644 --- a/.ci/jenkins/dsl/jobs.groovy +++ b/.ci/jenkins/dsl/jobs.groovy @@ -190,6 +190,7 @@ void setupDeployJob(JobType jobType, String envName = '') { stringParam('PROJECT_VERSION', '', 'Optional if not RELEASE. If RELEASE, cannot be empty.') stringParam('DROOLS_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.') }