From 6de1ca1ee872b399cada4cdee97225e04189363b Mon Sep 17 00:00:00 2001 From: Michael Biarnes Kiefer Date: Thu, 3 Aug 2023 15:32:39 +0200 Subject: [PATCH] KOGITO-5386: added a new parameter for unique branch name --- .ci/jenkins/Jenkinsfile.deploy | 7 +++++-- .ci/jenkins/dsl/jobs.groovy | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) 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.') }