Skip to content

Commit

Permalink
9.x: Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
radtriste authored Jul 24, 2023
1 parent 478f8ea commit 6ec5bf0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .ci/jenkins/Jenkinsfile.setup-branch
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pipeline {
}
stage('Update Drools version in kie-benchmarks') {
when {
expression { isMainBranch() }
expression { isStream8() && isMainBranch() }
}
steps {
script {
Expand Down Expand Up @@ -157,3 +157,7 @@ void mergeAndPush(String prLink, String targetBranch) {
githubscm.pushObject('origin', targetBranch, getGitAuthorCredsId())
}
}

boolean isStream8() {
return env.DROOLS_STREAM == '8'
}
32 changes: 29 additions & 3 deletions .ci/jenkins/dsl/jobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ import org.kie.jenkins.jobdsl.Utils

jenkins_path = '.ci/jenkins'

boolean isStream8() {
return getDroolsStream() == '8'
}

String getDroolsStream() {
String gitMainBranch = "${GIT_MAIN_BRANCH}"
if (gitMainBranch == 'main') {
return '8'
} else if (gitMainBranch == '9.x') {
return '9'
} else {
return gitMainBranch
}
}

///////////////////////////////////////////////////////////////////////////////////////////
// Whole Drools project jobs
///////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -48,7 +63,8 @@ void createProjectSetupBranchJob() {

GIT_BRANCH_NAME: "${GIT_BRANCH}",

IS_MAIN_BRANCH: "${Utils.isMainBranch(this)}"
IS_MAIN_BRANCH: "${Utils.isMainBranch(this)}",
DROOLS_STREAM: getDroolsStream(),
])
KogitoJobTemplate.createPipelineJob(this, jobParams)?.with {
parameters {
Expand All @@ -65,6 +81,8 @@ void setupProjectNightlyJob() {
JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}",

GIT_BRANCH_NAME: "${GIT_BRANCH}",

DROOLS_STREAM: getDroolsStream(),
])
KogitoJobTemplate.createPipelineJob(this, jobParams)?.with {
parameters {
Expand All @@ -83,6 +101,8 @@ void setupProjectReleaseJob() {

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

DROOLS_STREAM: getDroolsStream(),
])
KogitoJobTemplate.createPipelineJob(this, jobParams)?.with {
parameters {
Expand All @@ -104,7 +124,8 @@ 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 {
parameters {
Expand Down Expand Up @@ -241,7 +262,8 @@ void createSetupBranchJob() {

MAVEN_SETTINGS_CONFIG_FILE_ID: "${MAVEN_SETTINGS_FILE_ID}",

IS_MAIN_BRANCH: "${Utils.isMainBranch(this)}"
IS_MAIN_BRANCH: "${Utils.isMainBranch(this)}",
DROOLS_STREAM: getDroolsStream(),
])
KogitoJobTemplate.createPipelineJob(this, jobParams)?.with {
parameters {
Expand Down Expand Up @@ -271,6 +293,8 @@ void setupDeployJob(JobType jobType) {
MAVEN_SETTINGS_CONFIG_FILE_ID: "${MAVEN_SETTINGS_FILE_ID}",
MAVEN_DEPENDENCIES_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}",
MAVEN_DEPLOY_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}",

DROOLS_STREAM: getDroolsStream(),
])
if (jobType == JobType.RELEASE) {
jobParams.env.putAll([
Expand Down Expand Up @@ -311,6 +335,8 @@ void setupPromoteJob(JobType jobType) {
MAVEN_SETTINGS_CONFIG_FILE_ID: "${MAVEN_SETTINGS_FILE_ID}",
MAVEN_DEPENDENCIES_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}",
MAVEN_DEPLOY_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}",

DROOLS_STREAM: getDroolsStream(),
])
KogitoJobTemplate.createPipelineJob(this, jobParams)?.with {
parameters {
Expand Down

0 comments on commit 6ec5bf0

Please sign in to comment.