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

9.x: Fix CI #5400

Merged
merged 2 commits into from
Jul 24, 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
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'
}
26 changes: 23 additions & 3 deletions .ci/jenkins/dsl/jobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ import org.kie.jenkins.jobdsl.Utils

jenkins_path = '.ci/jenkins'

String getDroolsStream() {
radtriste marked this conversation as resolved.
Show resolved Hide resolved
String gitMainBranch = "${GIT_MAIN_BRANCH}"
if (gitMainBranch == 'main') {
return '8'
} else {
return gitMainBranch.split("\\.")[0]
}
}

///////////////////////////////////////////////////////////////////////////////////////////
// Whole Drools project jobs
///////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -48,7 +57,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 +75,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 +95,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 +118,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 +256,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 +287,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 +329,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
Loading