Skip to content

Commit

Permalink
kie-issues#423: Prepare for 2.x stream (#1035)
Browse files Browse the repository at this point in the history
* kie-issues#423: Prepare for 2.x stream

* update
  • Loading branch information
radtriste authored Aug 17, 2023
1 parent 5190bde commit d52f9db
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 15 deletions.
42 changes: 27 additions & 15 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 Expand Up @@ -189,8 +202,7 @@ void setupNightlyCloudJob() {
}

void setupQuarkus3NightlyJob() {
// TODO Tests would be done on 9.x/2.x branch => Create 2.x branch on Kogito

// Tests are done on 9.x/2.x branch => Create 2.x branch on Kogito
// Need to split as Drools and Kogito end up in different integration branches
KogitoJobUtils.createNightlyBuildChainIntegrationJob(this, 'quarkus-3', 'drools', true) { script ->
def jobParams = JobParamsUtils.getDefaultJobParams(script, 'drools')
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class JobParamsUtils {
parametersValues: [:],
env: [
REPO_NAME: repository,
STREAM: Utils.getStream(script),
],
pr: [
target_repository: repository,
Expand Down

0 comments on commit d52f9db

Please sign in to comment.