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

Quarkus 3: Split drools and kogito #1034

Merged
merged 3 commits into from
Aug 14, 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
15 changes: 15 additions & 0 deletions .ci/jenkins/Jenkinsfile.buildchain
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ if (isBranchBuildChainType()) {
skipTests = params.SKIP_TESTS ?: false
skipIntegrationTests = params.SKIP_INTEGRATION_TESTS ?: false

launchDownstreamJobs = env.LAUNCH_DOWNSTREAM_JOBS ? env.LAUNCH_DOWNSTREAM_JOBS.split(',') : []

notificationJobName = env.NOTIFICATION_JOB_NAME ?: 'PR'

pipeline {
Expand Down Expand Up @@ -181,6 +183,19 @@ pipeline {
}
}
}
stage('Trigger downstream jobs') {
when {
expression { return launchDownstreamJobs }
}
steps {
script {
launchDownstreamJobs.each {
echo "Launch downstream jobs with path ${it}"
build(job: "${it}", wait: false, parameters: [], propagate: false)
}
}
}
}
stage('check space after build') {
steps {
script {
Expand Down
18 changes: 16 additions & 2 deletions .ci/jenkins/dsl/jobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,29 @@ void setupNightlyCloudJob() {
}

void setupQuarkus3NightlyJob() {
// TODO Tests would be 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')
jobParams.git.branch = VersionUtils.getProjectTargetBranch('drools', Utils.getGitBranch(this), Utils.getRepoName(this))
jobParams.env.put('ADDITIONAL_TIMEOUT', '720')
jobParams.env.put('ADDITIONAL_TIMEOUT', '180')
jobParams.env.put('BUILD_ENVIRONMENT_OPTIONS_CURRENT', 'rewrite push_changes')
jobParams.env.put('INTEGRATION_BRANCH_CURRENT', '9.x')
jobParams.env.put('LAUNCH_DOWNSTREAM_JOBS', 'kogito-runtimes.integration')
jobParams.parametersValues.put('SKIP_TESTS', true)
jobParams.parametersValues.put('SKIP_INTEGRATION_TESTS', true)
return jobParams
}
KogitoJobUtils.createBuildChainIntegrationJob(this, 'quarkus-3', 'kogito-runtimes', true) { script ->
def jobParams = JobParamsUtils.getDefaultJobParams(script, 'kogito-runtimes')
jobParams.env.put('ADDITIONAL_TIMEOUT', '720')
jobParams.env.put('BUILD_ENVIRONMENT_OPTIONS_CURRENT', 'rewrite push_changes')
jobParams.env.put('INTEGRATION_BRANCH_CURRENT', '2.x')
jobParams.env.put('BUILDCHAIN_FULL_BRANCH_DOWNSTREAM_BUILD', 'true')
jobParams.env.put('NODE_OPTIONS', '--max_old_space_size=4096')
JobParamsUtils.setupJobParamsDeployConfiguration(script, jobParams)
jobParams.parametersValues.put('SKIP_TESTS', true)
jobParams.parametersValues.put('SKIP_INTEGRATION_TESTS', true)
return jobParams
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,21 @@ class KogitoJobUtils {
*
*/
static def createNightlyBuildChainIntegrationJob(def script, String envName, String repository, boolean enableNotification = false, Closure defaultJobParamsGetter = JobParamsUtils.DEFAULT_PARAMS_GETTER) {
return createBuildChainIntegrationJob(script, envName, repository, enableNotification) { jenkinsScript ->
def jobParams = defaultJobParamsGetter(jenkinsScript)
jobParams.triggers = jobParams.triggers ?: [ cron : '@midnight' ] // To remove once environment nightlies are managed by main nightly pipeline
return jobParams
}
}

/**
* Create a job creating an integration branch when performing the build
*
* This job will call the build-chain with extra environment variables to allow for the creation of an integration branch
*
*/
static def createBuildChainIntegrationJob(def script, String envName, String repository, boolean enableNotification = false, Closure defaultJobParamsGetter = JobParamsUtils.DEFAULT_PARAMS_GETTER) {
def jobParams = JobParamsUtils.getSeedJobParamsWithEnv(script, "${repository}.integration", JobType.NIGHTLY, envName, KogitoConstants.BUILD_CHAIN_JENKINSFILE, "Integration with Quarkus for ${repository} using the build-chain", defaultJobParamsGetter)
jobParams.triggers = jobParams.triggers ?: [ cron : '@midnight' ] // To remove once environment nightlies are managed by main nightly pipeline
if (!envName) {
throw new RuntimeException('Please provide a non-empty environment to generate an integration branch job...')
}
Expand All @@ -294,12 +307,12 @@ class KogitoJobUtils {
JobParamsUtils.setupJobParamsBuildChainConfiguration(script, jobParams, repository, 'branch', notificationJobName)

jobParams.parametersClosures.add({
stringParam('DISPLAY_NAME', '', 'Setup a specific build display name')
stringParam('DISPLAY_NAME', jobParams.parametersValues?.DISPLAY_NAME ?: '', 'Setup a specific build display name')

stringParam('GIT_BRANCH_NAME', Utils.getGitBranch(script), 'Set the Git branch to test')

booleanParam('SKIP_TESTS', false, 'Skip tests')
booleanParam('SKIP_INTEGRATION_TESTS', false, 'Skip IT tests')
booleanParam('SKIP_TESTS', jobParams.parametersValues?.SKIP_TESTS ?: false, 'Skip tests')
booleanParam('SKIP_INTEGRATION_TESTS', jobParams.parametersValues?.SKIP_INTEGRATION_TESTS ?: false, 'Skip IT tests')
})
jobParams.env.putAll([
JENKINS_EMAIL_CREDS_ID: Utils.getJenkinsEmailCredsId(script),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class JobParamsUtils {
token_credentials: Utils.getGitAuthorTokenCredsId(script)
],
parametersClosures: [],
parametersValues: [:],
env: [
REPO_NAME: repository,
],
Expand Down