From 04696513ca807e353a43f9702246ce821b4ceffd Mon Sep 17 00:00:00 2001 From: radtriste Date: Mon, 14 Aug 2023 15:31:45 +0200 Subject: [PATCH] kie-issues#423: 9.x: Remove build-chain patch --- .../quarkus-3/patches/1000_ci_updates.patch | 302 ------------------ .ci/jenkins/Jenkinsfile.deploy | 6 +- .ci/jenkins/Jenkinsfile.promote | 6 +- .ci/jenkins/Jenkinsfile.setup-branch | 6 +- .ci/jenkins/dsl/jobs.groovy | 81 ++--- 5 files changed, 53 insertions(+), 348 deletions(-) delete mode 100644 .ci/environments/quarkus-3/patches/1000_ci_updates.patch diff --git a/.ci/environments/quarkus-3/patches/1000_ci_updates.patch b/.ci/environments/quarkus-3/patches/1000_ci_updates.patch deleted file mode 100644 index 4beaac848c9f..000000000000 --- a/.ci/environments/quarkus-3/patches/1000_ci_updates.patch +++ /dev/null @@ -1,302 +0,0 @@ -diff --git a/.ci/buildchain-config.yaml b/.ci/buildchain-config.yaml -index 6d2cbb3b8b..a31edb288d 100644 ---- a/.ci/buildchain-config.yaml -+++ b/.ci/buildchain-config.yaml -@@ -36,34 +36,34 @@ build: - upstream: | - mvn clean install -Dquickly ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_UPSTREAM }} ${{ env.DROOLS_BUILD_MVN_OPTS_UPSTREAM }} - -- - project: kiegroup/kogito-runtimes -- build-command: -- current: | -- export MVN_CMD=`bash -c "if [ '${{ env.ENABLE_DEPLOY }}' = 'true' ]; then printf 'deploy ${{ env.DEPLOY_MVN_OPTS }} ${{ env.KOGITO_RUNTIMES_DEPLOY_MVN_OPTS }}'; else printf 'install'; fi"` -- mvn clean ${{ env.MVN_CMD }} -Dfull ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_CURRENT }} ${{ env.KOGITO_RUNTIMES_BUILD_MVN_OPTS }} -- upstream: | -- mvn clean install -Dquickly -Dfull ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_UPSTREAM }} ${{ env.KOGITO_RUNTIMES_BUILD_MVN_OPTS_UPSTREAM }} -+ # - project: kiegroup/kogito-runtimes -+ # build-command: -+ # current: | -+ # export MVN_CMD=`bash -c "if [ '${{ env.ENABLE_DEPLOY }}' = 'true' ]; then printf 'deploy ${{ env.DEPLOY_MVN_OPTS }} ${{ env.KOGITO_RUNTIMES_DEPLOY_MVN_OPTS }}'; else printf 'install'; fi"` -+ # mvn clean ${{ env.MVN_CMD }} -Dfull ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_CURRENT }} ${{ env.KOGITO_RUNTIMES_BUILD_MVN_OPTS }} -+ # upstream: | -+ # mvn clean install -Dquickly -Dfull ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_UPSTREAM }} ${{ env.KOGITO_RUNTIMES_BUILD_MVN_OPTS_UPSTREAM }} - -- - project: kiegroup/kogito-apps -- build-command: -- current: | -- export MVN_CMD=`bash -c "if [ '${{ env.ENABLE_DEPLOY }}' = 'true' ]; then printf 'deploy ${{ env.DEPLOY_MVN_OPTS }} ${{ env.KOGITO_APPS_DEPLOY_MVN_OPTS }}'; else printf 'install'; fi"` -- mvn clean ${{ env.MVN_CMD }} ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_CURRENT }} ${{ env.KOGITO_APPS_BUILD_MVN_OPTS }} -- upstream: | -- mvn clean install -Dquickly ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_UPSTREAM }} ${{ env.KOGITO_APPS_BUILD_MVN_OPTS_UPSTREAM }} -- archive-artifacts: -- path: | -- **/*.log -- **/cypress/screenshots/** -- **/cypress/videos/** -+ # - project: kiegroup/kogito-apps -+ # build-command: -+ # current: | -+ # export MVN_CMD=`bash -c "if [ '${{ env.ENABLE_DEPLOY }}' = 'true' ]; then printf 'deploy ${{ env.DEPLOY_MVN_OPTS }} ${{ env.KOGITO_APPS_DEPLOY_MVN_OPTS }}'; else printf 'install'; fi"` -+ # mvn clean ${{ env.MVN_CMD }} ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_CURRENT }} ${{ env.KOGITO_APPS_BUILD_MVN_OPTS }} -+ # upstream: | -+ # mvn clean install -Dquickly ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_UPSTREAM }} ${{ env.KOGITO_APPS_BUILD_MVN_OPTS_UPSTREAM }} -+ # archive-artifacts: -+ # path: | -+ # **/*.log -+ # **/cypress/screenshots/** -+ # **/cypress/videos/** - -- - project: kiegroup/kogito-examples -- build-command: -- # First install the main pom -- # Then build the required submodule pom -- current: | -- export MVN_CMD=`bash -c "if [ '${{ env.ENABLE_DEPLOY }}' = 'true' ]; then printf 'deploy ${{ env.DEPLOY_MVN_OPTS }} ${{ env.KOGITO_EXAMPLES_DEPLOY_MVN_OPTS }}'; else printf 'install'; fi"` -- mvn -pl :kogito-examples clean ${{ env.MVN_CMD }} ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_CURRENT }} ${{ env.KOGITO_EXAMPLES_BUILD_MVN_OPTS }} -- mvn -f ${{ env.KOGITO_EXAMPLES_SUBFOLDER_POM }}pom.xml clean ${{ env.MVN_CMD }} ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_CURRENT }} ${{ env.KOGITO_EXAMPLES_BUILD_MVN_OPTS }} -- upstream: | -- mvn clean install -Dquickly ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_UPSTREAM }} ${{ env.KOGITO_EXAMPLES_BUILD_MVN_OPTS_UPSTREAM }} -+ # - project: kiegroup/kogito-examples -+ # build-command: -+ # # First install the main pom -+ # # Then build the required submodule pom -+ # current: | -+ # export MVN_CMD=`bash -c "if [ '${{ env.ENABLE_DEPLOY }}' = 'true' ]; then printf 'deploy ${{ env.DEPLOY_MVN_OPTS }} ${{ env.KOGITO_EXAMPLES_DEPLOY_MVN_OPTS }}'; else printf 'install'; fi"` -+ # mvn -pl :kogito-examples clean ${{ env.MVN_CMD }} ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_CURRENT }} ${{ env.KOGITO_EXAMPLES_BUILD_MVN_OPTS }} -+ # mvn -f ${{ env.KOGITO_EXAMPLES_SUBFOLDER_POM }}pom.xml clean ${{ env.MVN_CMD }} ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_CURRENT }} ${{ env.KOGITO_EXAMPLES_BUILD_MVN_OPTS }} -+ # upstream: | -+ # mvn clean install -Dquickly ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_UPSTREAM }} ${{ env.KOGITO_EXAMPLES_BUILD_MVN_OPTS_UPSTREAM }} -diff --git a/.ci/buildchain-project-dependencies.yaml b/.ci/buildchain-project-dependencies.yaml -index 31d0afcc93..e838342fb7 100644 ---- a/.ci/buildchain-project-dependencies.yaml -+++ b/.ci/buildchain-project-dependencies.yaml -@@ -11,51 +11,51 @@ dependencies: - - source: (\d*)\.(.*)\.(.*) - targetExpression: "process.env.GITHUB_BASE_REF.replace(/(\\d*)\\.(.*)\\.(.*)/g, (m, n1, n2, n3) => `${+n1+7}.${n2}.${n3}`)" - -- - project: kiegroup/kogito-runtimes -- dependencies: -- - project: kiegroup/drools -- mapping: -- dependencies: -- default: -- - source: (\d*)\.(.*)\.(.*) -- targetExpression: "process.env.GITHUB_BASE_REF.replace(/(\\d*)\\.(.*)\\.(.*)/g, (m, n1, n2, n3) => `${+n1+7}.${n2}.${n3}`)" -- dependant: -- default: -- - source: (\d*)\.(.*)\.(.*) -- targetExpression: "process.env.GITHUB_BASE_REF.replace(/(\\d*)\\.(.*)\\.(.*)/g, (m, n1, n2, n3) => `${+n1-7}.${n2}.${n3}`)" -- exclude: -- - kiegroup/kogito-examples -- - kiegroup/kogito-apps -+ # - project: kiegroup/kogito-runtimes -+ # dependencies: -+ # - project: kiegroup/drools -+ # mapping: -+ # dependencies: -+ # default: -+ # - source: (\d*)\.(.*)\.(.*) -+ # targetExpression: "process.env.GITHUB_BASE_REF.replace(/(\\d*)\\.(.*)\\.(.*)/g, (m, n1, n2, n3) => `${+n1+7}.${n2}.${n3}`)" -+ # dependant: -+ # default: -+ # - source: (\d*)\.(.*)\.(.*) -+ # targetExpression: "process.env.GITHUB_BASE_REF.replace(/(\\d*)\\.(.*)\\.(.*)/g, (m, n1, n2, n3) => `${+n1-7}.${n2}.${n3}`)" -+ # exclude: -+ # - kiegroup/kogito-examples -+ # - kiegroup/kogito-apps - -- - project: kiegroup/kogito-apps -- dependencies: -- - project: kiegroup/kogito-runtimes -- mapping: -- dependencies: -- default: -- - source: (\d*)\.(.*)\.(.*) -- targetExpression: "process.env.GITHUB_BASE_REF.replace(/(\\d*)\\.(.*)\\.(.*)/g, (m, n1, n2, n3) => `${+n1+7}.${n2}.${n3}`)" -- dependant: -- default: -- - source: (\d*)\.(.*)\.(.*) -- targetExpression: "process.env.GITHUB_BASE_REF.replace(/(\\d*)\\.(.*)\\.(.*)/g, (m, n1, n2, n3) => `${+n1-7}.${n2}.${n3}`)" -- exclude: -- - kiegroup/kogito-examples -- - kiegroup/kogito-runtimes -+ # - project: kiegroup/kogito-apps -+ # dependencies: -+ # - project: kiegroup/kogito-runtimes -+ # mapping: -+ # dependencies: -+ # default: -+ # - source: (\d*)\.(.*)\.(.*) -+ # targetExpression: "process.env.GITHUB_BASE_REF.replace(/(\\d*)\\.(.*)\\.(.*)/g, (m, n1, n2, n3) => `${+n1+7}.${n2}.${n3}`)" -+ # dependant: -+ # default: -+ # - source: (\d*)\.(.*)\.(.*) -+ # targetExpression: "process.env.GITHUB_BASE_REF.replace(/(\\d*)\\.(.*)\\.(.*)/g, (m, n1, n2, n3) => `${+n1-7}.${n2}.${n3}`)" -+ # exclude: -+ # - kiegroup/kogito-examples -+ # - kiegroup/kogito-runtimes - -- - project: kiegroup/kogito-examples -- dependencies: -- - project: kiegroup/kogito-runtimes -- - project: kiegroup/kogito-apps -- mapping: -- dependencies: -- default: -- - source: (\d*)\.(.*)\.(.*) -- targetExpression: "process.env.GITHUB_BASE_REF.replace(/(\\d*)\\.(.*)\\.(.*)/g, (m, n1, n2, n3) => `${+n1+7}.${n2}.${n3}`)" -- dependant: -- default: -- - source: (\d*)\.(.*)\.(.*) -- targetExpression: "process.env.GITHUB_BASE_REF.replace(/(\\d*)\\.(.*)\\.(.*)/g, (m, n1, n2, n3) => `${+n1-7}.${n2}.${n3}`)" -- exclude: -- - kiegroup/kogito-apps -- - kiegroup/kogito-runtimes -+ # - project: kiegroup/kogito-examples -+ # dependencies: -+ # - project: kiegroup/kogito-runtimes -+ # - project: kiegroup/kogito-apps -+ # mapping: -+ # dependencies: -+ # default: -+ # - source: (\d*)\.(.*)\.(.*) -+ # targetExpression: "process.env.GITHUB_BASE_REF.replace(/(\\d*)\\.(.*)\\.(.*)/g, (m, n1, n2, n3) => `${+n1+7}.${n2}.${n3}`)" -+ # dependant: -+ # default: -+ # - source: (\d*)\.(.*)\.(.*) -+ # targetExpression: "process.env.GITHUB_BASE_REF.replace(/(\\d*)\\.(.*)\\.(.*)/g, (m, n1, n2, n3) => `${+n1-7}.${n2}.${n3}`)" -+ # exclude: -+ # - kiegroup/kogito-apps -+ # - kiegroup/kogito-runtimes -diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy -index 22bf185da2..69005f41c0 100644 ---- a/.ci/jenkins/dsl/jobs.groovy -+++ b/.ci/jenkins/dsl/jobs.groovy -@@ -70,7 +70,7 @@ void createProjectSetupBranchJob() { - - void setupProjectNightlyJob() { - def jobParams = JobParamsUtils.getBasicJobParams(this, '0-nightly', JobType.NIGHTLY, "${jenkins_path_project}/Jenkinsfile.nightly", 'Drools Nightly') -- jobParams.triggers = [cron : '@midnight'] -+ jobParams.triggers = [cron : 'H 3 * * *'] - jobParams.env.putAll([ - JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", - -@@ -135,7 +135,7 @@ void setupProjectPostReleaseJob() { - /////////////////////////////////////////////////////////////////////////////////////////// - - Map getMultijobPRConfig(JenkinsFolder jobFolder) { -- String defaultBuildMvnOptsCurrent = jobFolder.getDefaultEnvVarValue('BUILD_MVN_OPTS_CURRENT') ?: '' -+ // String defaultBuildMvnOptsCurrent = jobFolder.getDefaultEnvVarValue('BUILD_MVN_OPTS_CURRENT') ?: '' - def jobConfig = [ - parallel: true, - buildchain: true, -@@ -148,35 +148,35 @@ Map getMultijobPRConfig(JenkinsFolder jobFolder) { - // As we have only Community edition - ENABLE_SONARCLOUD: EnvUtils.isDefaultEnvironment(this, jobFolder.getEnvironmentName()) && Utils.isMainBranch(this), - // Setup full build if not prod profile -- BUILD_MVN_OPTS_CURRENT: "${defaultBuildMvnOptsCurrent} ${EnvUtils.hasEnvironmentId(this, jobFolder.getEnvironmentName(), 'prod') || EnvUtils.hasEnvironmentId(this, jobFolder.getEnvironmentName(), 'quarkus3') ? '' : '-Dfull'}", -+ // BUILD_MVN_OPTS_CURRENT: "${defaultBuildMvnOptsCurrent} ${EnvUtils.hasEnvironmentId(this, jobFolder.getEnvironmentName(), 'prod') || EnvUtils.hasEnvironmentId(this, jobFolder.getEnvironmentName(), 'quarkus3') ? '' : '-Dfull'}", - ] -- ], [ -- id: 'kogito-runtimes', -- repository: 'kogito-runtimes' -- ], [ -- id: 'kogito-apps', -- repository: 'kogito-apps', -- env : [ -- NODE_OPTIONS: '--max_old_space_size=4096', -- ] -- ], [ -- id: 'kogito-quarkus-examples', -- repository: 'kogito-examples', -- env : [ -- KOGITO_EXAMPLES_SUBFOLDER_POM: 'kogito-quarkus-examples/', -- ], -- ], [ -- id: 'kogito-springboot-examples', -- repository: 'kogito-examples', -- env : [ -- KOGITO_EXAMPLES_SUBFOLDER_POM: 'kogito-springboot-examples/', -- ], -- ], [ -- id: 'serverless-workflow-examples', -- repository: 'kogito-examples', -- env : [ -- KOGITO_EXAMPLES_SUBFOLDER_POM: 'serverless-workflow-examples/', -- ], -+ // ], [ -+ // id: 'kogito-runtimes', -+ // repository: 'kogito-runtimes' -+ // ], [ -+ // id: 'kogito-apps', -+ // repository: 'kogito-apps', -+ // env : [ -+ // NODE_OPTIONS: '--max_old_space_size=4096', -+ // ] -+ // ], [ -+ // id: 'kogito-quarkus-examples', -+ // repository: 'kogito-examples', -+ // env : [ -+ // KOGITO_EXAMPLES_SUBFOLDER_POM: 'kogito-quarkus-examples/', -+ // ], -+ // ], [ -+ // id: 'kogito-springboot-examples', -+ // repository: 'kogito-examples', -+ // env : [ -+ // KOGITO_EXAMPLES_SUBFOLDER_POM: 'kogito-springboot-examples/', -+ // ], -+ // ], [ -+ // id: 'serverless-workflow-examples', -+ // repository: 'kogito-examples', -+ // env : [ -+ // KOGITO_EXAMPLES_SUBFOLDER_POM: 'serverless-workflow-examples/', -+ // ], - ] - ] - ] -@@ -202,17 +202,23 @@ Closure addFullProfileJobParamsGetter = { script -> - return jobParams - } - --KogitoJobUtils.createNightlyBuildChainBuildAndDeployJobForCurrentRepo(this, '', true, addFullProfileJobParamsGetter) -+Closure setup3AMCronTriggerJobParamsGetter = { script -> -+ def jobParams = JobParamsUtils.DEFAULT_PARAMS_GETTER(script) -+ jobParams.triggers = [ cron: 'H 3 * * *' ] -+ return jobParams -+} -+ -+KogitoJobUtils.createNightlyBuildChainBuildAndDeployJobForCurrentRepo(this, '', true) - - // Environment nightlies --setupSpecificBuildChainNightlyJob('native', addFullProfileJobParamsGetter) --setupSpecificBuildChainNightlyJob('sonarcloud', addFullProfileJobParamsGetter) -+setupSpecificBuildChainNightlyJob('native', setup3AMCronTriggerJobParamsGetter) -+setupSpecificBuildChainNightlyJob('sonarcloud', setup3AMCronTriggerJobParamsGetter) - - // Jobs with integration branch --setupQuarkusIntegrationJob('quarkus-main', addFullProfileJobParamsGetter) --setupQuarkusIntegrationJob('quarkus-branch', addFullProfileJobParamsGetter) --setupQuarkusIntegrationJob('quarkus-lts') --setupQuarkusIntegrationJob('native-lts') -+setupQuarkusIntegrationJob('quarkus-main', setup3AMCronTriggerJobParamsGetter) -+setupQuarkusIntegrationJob('quarkus-branch', setup3AMCronTriggerJobParamsGetter) -+// setupQuarkusIntegrationJob('quarkus-lts') -+// setupQuarkusIntegrationJob('native-lts') - // Quarkus 3 nightly is exported to Kogito pipelines for easier integration - - // Release jobs -@@ -227,10 +233,10 @@ KogitoJobUtils.createQuarkusUpdateToolsJob(this, 'drools', [ - ]) - - // Quarkus 3 --if (EnvUtils.isEnvironmentEnabled(this, 'quarkus-3')) { -- // setupPrQuarkus3RewriteJob() # TODO to enable if you want the PR quarkus-3 rewrite job -- setupStandaloneQuarkus3RewriteJob() --} -+// if (EnvUtils.isEnvironmentEnabled(this, 'quarkus-3')) { -+// // setupPrQuarkus3RewriteJob() # TODO to enable if you want the PR quarkus-3 rewrite job -+// setupStandaloneQuarkus3RewriteJob() -+// } - - ///////////////////////////////////////////////////////////////// - // Methods diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index f8fc532ca320..1ac3cf091035 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -262,7 +262,7 @@ MavenCommand getMavenCommand(String directory = '') { def mvnCmd = new MavenCommand(this, ['-fae', '-ntp']) .withSettingsXmlId(env.MAVEN_SETTINGS_CONFIG_FILE_ID) .inDirectory(directory) - if (!isStream8()) { // Workaround as enforcer rules may not be fixed on other streams + if (!isMainStream()) { // Workaround as enforcer rules may not be fixed on other streams mvnCmd.withProperty('enforcer.skip') } else { mvnCmd.withProperty('full') @@ -298,6 +298,6 @@ String getLocalDeploymentFolder() { return "${env.MAVEN_DEPLOY_LOCAL_DIR}/${getRepoName()}" } -boolean isStream8() { - return env.DROOLS_STREAM == '8' +boolean isMainStream() { + return env.DROOLS_STREAM == 'main' } \ No newline at end of file diff --git a/.ci/jenkins/Jenkinsfile.promote b/.ci/jenkins/Jenkinsfile.promote index be7c1933ac41..4e9db642c5c7 100644 --- a/.ci/jenkins/Jenkinsfile.promote +++ b/.ci/jenkins/Jenkinsfile.promote @@ -71,7 +71,7 @@ pipeline { stage('Upload drools binaries and documentation') { when { - expression { return isStream8() } + expression { return isMainStream() } } steps { script { @@ -218,6 +218,6 @@ boolean isNotTestingBuild() { return getGitAuthor() == 'kiegroup' } -boolean isStream8() { - return env.DROOLS_STREAM == '8' +boolean isMainStream() { + return env.DROOLS_STREAM == 'main' } diff --git a/.ci/jenkins/Jenkinsfile.setup-branch b/.ci/jenkins/Jenkinsfile.setup-branch index 4b8bd5900edc..ebbc6cfb8cb7 100644 --- a/.ci/jenkins/Jenkinsfile.setup-branch +++ b/.ci/jenkins/Jenkinsfile.setup-branch @@ -78,7 +78,7 @@ pipeline { } stage('Update Drools version in kie-benchmarks') { when { - expression { isStream8() && isMainBranch() } + expression { isMainStream() && isMainBranch() } } steps { script { @@ -158,6 +158,6 @@ void mergeAndPush(String prLink, String targetBranch) { } } -boolean isStream8() { - return env.DROOLS_STREAM == '8' +boolean isMainStream() { + return env.DROOLS_STREAM == 'main' } diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy index 5113f1bf7e38..df7ba9a3295d 100644 --- a/.ci/jenkins/dsl/jobs.groovy +++ b/.ci/jenkins/dsl/jobs.groovy @@ -18,13 +18,8 @@ import org.kie.jenkins.jobdsl.Utils jenkins_path = '.ci/jenkins' -String getDroolsStream() { - String gitMainBranch = "${GIT_MAIN_BRANCH}" - if (gitMainBranch == 'main') { - return '8' - } else { - return gitMainBranch.split("\\.")[0] - } +boolean isMainStream() { + return Utils.getStream(this) == 'main' } /////////////////////////////////////////////////////////////////////////////////////////// @@ -58,7 +53,7 @@ void createProjectSetupBranchJob() { GIT_BRANCH_NAME: "${GIT_BRANCH}", IS_MAIN_BRANCH: "${Utils.isMainBranch(this)}", - DROOLS_STREAM: getDroolsStream(), + DROOLS_STREAM: Utils.getStream(this), ]) KogitoJobTemplate.createPipelineJob(this, jobParams)?.with { parameters { @@ -70,13 +65,13 @@ void createProjectSetupBranchJob() { void setupProjectNightlyJob() { def jobParams = JobParamsUtils.getBasicJobParams(this, '0-nightly', JobType.NIGHTLY, "${jenkins_path_project}/Jenkinsfile.nightly", 'Drools Nightly') - jobParams.triggers = [cron : '@midnight'] + jobParams.triggers = [cron : isMainStream() ? '@midnight' : 'H 3 * * *'] jobParams.env.putAll([ JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", GIT_BRANCH_NAME: "${GIT_BRANCH}", - - DROOLS_STREAM: getDroolsStream(), + + DROOLS_STREAM: Utils.getStream(this), ]) KogitoJobTemplate.createPipelineJob(this, jobParams)?.with { parameters { @@ -96,7 +91,7 @@ void setupProjectReleaseJob() { DEFAULT_STAGING_REPOSITORY: "${MAVEN_NEXUS_STAGING_PROFILE_URL}", ARTIFACTS_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}", - DROOLS_STREAM: getDroolsStream(), + DROOLS_STREAM: Utils.getStream(this), ]) KogitoJobTemplate.createPipelineJob(this, jobParams)?.with { parameters { @@ -119,7 +114,7 @@ void setupProjectPostReleaseJob() { GIT_AUTHOR: "${GIT_AUTHOR_NAME}", AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}", - DROOLS_STREAM: getDroolsStream(), + DROOLS_STREAM: Utils.getStream(this), ]) KogitoJobTemplate.createPipelineJob(this, jobParams)?.with { parameters { @@ -135,7 +130,13 @@ void setupProjectPostReleaseJob() { /////////////////////////////////////////////////////////////////////////////////////////// Map getMultijobPRConfig(JenkinsFolder jobFolder) { - String defaultBuildMvnOptsCurrent = jobFolder.getDefaultEnvVarValue('BUILD_MVN_OPTS_CURRENT') ?: '' + String currentMvnOptsCurrent = jobFolder.getDefaultEnvVarValue('BUILD_MVN_OPTS_CURRENT') ?: '' + if (isMainStream() && !EnvUtils.hasEnvironmentId(this, jobFolder.getEnvironmentName(), 'prod') + && !EnvUtils.hasEnvironmentId(this, jobFolder.getEnvironmentName(), 'quarkus3')) { + // Setup full build if not prod profile + currentMvnOptsCurrent += ' -Dfull' + } + def jobConfig = [ parallel: true, buildchain: true, @@ -147,8 +148,7 @@ Map getMultijobPRConfig(JenkinsFolder jobFolder) { // Sonarcloud analysis only on main branch // As we have only Community edition ENABLE_SONARCLOUD: EnvUtils.isDefaultEnvironment(this, jobFolder.getEnvironmentName()) && Utils.isMainBranch(this), - // Setup full build if not prod profile - BUILD_MVN_OPTS_CURRENT: "${defaultBuildMvnOptsCurrent} ${EnvUtils.hasEnvironmentId(this, jobFolder.getEnvironmentName(), 'prod') || EnvUtils.hasEnvironmentId(this, jobFolder.getEnvironmentName(), 'quarkus3') ? '' : '-Dfull'}", + BUILD_MVN_OPTS_CURRENT: currentMvnOptsCurrent, ] ], [ id: 'kogito-runtimes', @@ -202,17 +202,23 @@ Closure addFullProfileJobParamsGetter = { script -> return jobParams } -KogitoJobUtils.createNightlyBuildChainBuildAndDeployJobForCurrentRepo(this, '', true, addFullProfileJobParamsGetter) +Closure setup3AMCronTriggerJobParamsGetter = { script -> + def jobParams = JobParamsUtils.DEFAULT_PARAMS_GETTER(script) + jobParams.triggers = [ cron: 'H 3 * * *' ] + return jobParams +} + +KogitoJobUtils.createNightlyBuildChainBuildAndDeployJobForCurrentRepo(this, '', true, isMainStream() ? addFullProfileJobParamsGetter : JobParamsUtils.DEFAULT_PARAMS_GETTER) // Environment nightlies -setupSpecificBuildChainNightlyJob('native', addFullProfileJobParamsGetter) -setupSpecificBuildChainNightlyJob('sonarcloud', addFullProfileJobParamsGetter) +setupSpecificBuildChainNightlyJob('native', isMainStream() ? addFullProfileJobParamsGetter : setup3AMCronTriggerJobParamsGetter) +setupSpecificBuildChainNightlyJob('sonarcloud', isMainStream() ? addFullProfileJobParamsGetter : setup3AMCronTriggerJobParamsGetter) // Jobs with integration branch -setupQuarkusIntegrationJob('quarkus-main', addFullProfileJobParamsGetter) -setupQuarkusIntegrationJob('quarkus-branch', addFullProfileJobParamsGetter) -setupQuarkusIntegrationJob('quarkus-lts') -setupQuarkusIntegrationJob('native-lts') +setupQuarkusIntegrationJob('quarkus-main', isMainStream() ? addFullProfileJobParamsGetter : setup3AMCronTriggerJobParamsGetter) +setupQuarkusIntegrationJob('quarkus-branch', isMainStream() ? addFullProfileJobParamsGetter : setup3AMCronTriggerJobParamsGetter) +setupQuarkusIntegrationJob('quarkus-lts', isMainStream() ? addFullProfileJobParamsGetter : setup3AMCronTriggerJobParamsGetter) +setupQuarkusIntegrationJob('native-lts', isMainStream() ? addFullProfileJobParamsGetter : setup3AMCronTriggerJobParamsGetter) // Quarkus 3 nightly is exported to Kogito pipelines for easier integration // Release jobs @@ -220,16 +226,18 @@ setupDeployJob(JobType.RELEASE) setupPromoteJob(JobType.RELEASE) // Tools job -KogitoJobUtils.createQuarkusUpdateToolsJob(this, 'drools', [ - modules: [ 'drools-build-parent' ], - compare_deps_remote_poms: [ 'io.quarkus:quarkus-bom' ], - properties: [ 'version.io.quarkus' ], -]) - -// Quarkus 3 -if (EnvUtils.isEnvironmentEnabled(this, 'quarkus-3')) { - // setupPrQuarkus3RewriteJob() # TODO to enable if you want the PR quarkus-3 rewrite job - setupStandaloneQuarkus3RewriteJob() +if (isMainStream()) { + KogitoJobUtils.createQuarkusUpdateToolsJob(this, 'drools', [ + modules: [ 'drools-build-parent' ], + compare_deps_remote_poms: [ 'io.quarkus:quarkus-bom' ], + properties: [ 'version.io.quarkus' ], + ]) + + // Quarkus 3 + if (EnvUtils.isEnvironmentEnabled(this, 'quarkus-3')) { + // setupPrQuarkus3RewriteJob() # TODO to enable if you want the PR quarkus-3 rewrite job + setupStandaloneQuarkus3RewriteJob() + } } ///////////////////////////////////////////////////////////////// @@ -257,7 +265,7 @@ void createSetupBranchJob() { MAVEN_SETTINGS_CONFIG_FILE_ID: "${MAVEN_SETTINGS_FILE_ID}", IS_MAIN_BRANCH: "${Utils.isMainBranch(this)}", - DROOLS_STREAM: getDroolsStream(), + DROOLS_STREAM: Utils.getStream(this), ]) KogitoJobTemplate.createPipelineJob(this, jobParams)?.with { parameters { @@ -284,13 +292,12 @@ void setupDeployJob(JobType jobType) { AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}", GITHUB_TOKEN_CREDS_ID: "${GIT_AUTHOR_TOKEN_CREDENTIALS_ID}", - MAVEN_SETTINGS_CONFIG_FILE_ID: "${MAVEN_SETTINGS_FILE_ID}", MAVEN_DEPENDENCIES_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}", MAVEN_DEPLOY_REPOSITORY: "${MAVEN_ARTIFACTS_UPLOAD_REPOSITORY_URL}", MAVEN_REPO_CREDS_ID: "${MAVEN_ARTIFACTS_UPLOAD_REPOSITORY_CREDS_ID}", - DROOLS_STREAM: getDroolsStream(), + DROOLS_STREAM: Utils.getStream(this), ]) if (jobType == JobType.RELEASE) { jobParams.env.putAll([ @@ -333,7 +340,7 @@ void setupPromoteJob(JobType jobType) { MAVEN_DEPENDENCIES_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}", MAVEN_DEPLOY_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}", - DROOLS_STREAM: getDroolsStream(), + DROOLS_STREAM: Utils.getStream(this), ]) KogitoJobTemplate.createPipelineJob(this, jobParams)?.with { parameters {