Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KOGITO-5386: added a new parameter for unique branch name #5455

Merged
merged 1 commit into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .ci/jenkins/Jenkinsfile.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ pipeline {
steps {
script {
dir(getRepoName()) {
if (githubscm.isBranchExist('origin',getPRBranch())) {
githubscm.removeRemoteBranch('origin', getPRBranch())
}
githubscm.createBranch(getPRBranch())
}
}
Expand Down Expand Up @@ -241,7 +244,7 @@ String getProjectVersion() {
}

String getPRBranch() {
return "${getProjectVersion()}-${env.PR_BRANCH_HASH}"
return params.DROOLS_PR_BRANCH
}

String getGitAuthorCredsID() {
Expand Down
5 changes: 3 additions & 2 deletions .ci/jenkins/dsl/jobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void setupProjectReleaseJob() {

DEFAULT_STAGING_REPOSITORY: "${MAVEN_NEXUS_STAGING_PROFILE_URL}",
ARTIFACTS_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}",

DROOLS_STREAM: getDroolsStream(),
])
KogitoJobTemplate.createPipelineJob(this, jobParams)?.with {
Expand All @@ -118,7 +118,7 @@ void setupProjectPostReleaseJob() {
GIT_BRANCH_NAME: "${GIT_BRANCH}",
GIT_AUTHOR: "${GIT_AUTHOR_NAME}",
AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}",

DROOLS_STREAM: getDroolsStream(),
])
KogitoJobTemplate.createPipelineJob(this, jobParams)?.with {
Expand Down Expand Up @@ -310,6 +310,7 @@ void setupDeployJob(JobType jobType) {

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('DROOLS_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
1 change: 1 addition & 0 deletions .ci/jenkins/project/Jenkinsfile.release
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ List getDefaultBuildParams() {
List buildParams = []
addDisplayNameParam(buildParams, getDisplayName(getDroolsVersion()))
addStringParam(buildParams, 'PROJECT_VERSION', getDroolsVersion())
addStringParam(buildParams, 'DROOLS_PR_BRANCH', "drools-${getDroolsVersion()}")
return buildParams
}

Expand Down