Skip to content

Commit

Permalink
kie-issues#423: Prepare for 2.x stream
Browse files Browse the repository at this point in the history
  • Loading branch information
radtriste committed Aug 14, 2023
1 parent 05827e0 commit e31495c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 13 deletions.
39 changes: 26 additions & 13 deletions .ci/jenkins/dsl/jobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,50 @@ import org.kie.jenkins.jobdsl.Utils

JENKINSFILE_PATH = '.ci/jenkins'

boolean isMainStream() {
return Utils.getStream(this) == 'main'
}

// PRs
setupKogitoRuntimesBDDPrJob()

// Tools
setupUpdateJenkinsDependenciesJob()
setupCreateIssueToolsJob()
setupCleanOldNamespacesToolsJob()
setupCleanOldNightlyImagesToolsJob()
KogitoJobUtils.createQuarkusPlatformUpdateToolsJob(this, 'kogito')
KogitoJobUtils.createMainQuarkusUpdateToolsJob(this,
if (isMainStream()) {
setupCreateIssueToolsJob()
setupCleanOldNamespacesToolsJob()
setupCleanOldNightlyImagesToolsJob()

KogitoJobUtils.createQuarkusPlatformUpdateToolsJob(this, 'kogito')
if (Utils.isMainBranch(this)) {
setupBuildOperatorNode()
}

KogitoJobUtils.createMainQuarkusUpdateToolsJob(this,
[ 'kogito-runtimes', 'kogito-examples', 'kogito-docs', 'kogito-images' ],
[ 'radtriste', 'cristianonicolai' ]
)
if (Utils.isMainBranch(this)) {
setupBuildOperatorNode()
)
}

// Setup branch branch
createSetupBranchJob()
createSetupBranchCloudJob()
if (isMainStream()) {
createSetupBranchCloudJob()
}

// Nightly
setupNightlyJob()
setupNightlyCloudJob()
setupQuarkusPlatformJob(JobType.NIGHTLY)
setupQuarkus3NightlyJob()
if (isMainStream()) {
setupNightlyCloudJob()
setupQuarkusPlatformJob(JobType.NIGHTLY)
setupQuarkus3NightlyJob()
}

KogitoJobUtils.createEnvironmentIntegrationBranchNightlyJob(this, 'quarkus-main')
KogitoJobUtils.createEnvironmentIntegrationBranchNightlyJob(this, 'quarkus-lts')
KogitoJobUtils.createEnvironmentIntegrationBranchNightlyJob(this, 'quarkus-branch')
KogitoJobUtils.createEnvironmentIntegrationBranchNightlyJob(this, 'native-lts')
KogitoJobUtils.createEnvironmentIntegrationBranchNightlyJob(this, 'quarkus-3')

// Release
setupReleaseArtifactsJob()
Expand Down Expand Up @@ -142,7 +155,7 @@ void createSetupBranchCloudJob() {

void setupNightlyJob() {
def jobParams = JobParamsUtils.getBasicJobParams(this, '0-kogito-nightly', JobType.NIGHTLY, "${JENKINSFILE_PATH}/Jenkinsfile.nightly", 'Kogito Nightly')
jobParams.triggers = [cron : '@midnight']
jobParams.triggers = [cron : isMainStream () ? '@midnight' : 'H 4 * * *']
jobParams.env.putAll([
JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}",

Expand Down
9 changes: 9 additions & 0 deletions dsl/seed/src/main/groovy/org/kie/jenkins/jobdsl/Utils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ class Utils {
return getBindingValue(script, 'GIT_MAIN_BRANCH')
}

static String getStream(def script) {
String gitMainBranch = Utils.getGitMainBranch(script)
if (gitMainBranch == 'main') {
return 'main'
} else {
return gitMainBranch.split("\\.")[0]
}
}

static boolean hasGitAuthor(def script) {
return hasBindingValue(script, 'GIT_AUTHOR_NAME')
}
Expand Down

0 comments on commit e31495c

Please sign in to comment.