This is an automated email from the ASF dual-hosted git repository. porcelli pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/incubator-kie-drools.git
commit a70b6d90daa4ae2e0163bb51f60d60e9424b6eda Author: Alex Porcelli <[email protected]> AuthorDate: Wed Mar 26 12:28:06 2025 -0400 10.1.0 release: after a try and run fail, reverted the cherry-pick and applied the 10.0.x state on top manually --- .ci/jenkins/Jenkinsfile | 2 +- .ci/jenkins/Jenkinsfile.deploy | 2 +- .ci/jenkins/Jenkinsfile.promote | 2 +- .ci/jenkins/Jenkinsfile.setup-branch | 2 +- .ci/jenkins/Jenkinsfile.weekly.deploy | 2 +- .ci/jenkins/config/branch.yaml | 20 +-- .ci/jenkins/config/main.yaml | 52 +++++-- .ci/jenkins/dsl/jobs.groovy | 215 +++++++++++++-------------- .ci/jenkins/project/Jenkinsfile.nightly | 2 +- .ci/jenkins/project/Jenkinsfile.release | 118 ++------------- .ci/jenkins/project/Jenkinsfile.setup-branch | 2 +- .ci/jenkins/project/Jenkinsfile.weekly | 2 +- 12 files changed, 177 insertions(+), 244 deletions(-) diff --git a/.ci/jenkins/Jenkinsfile b/.ci/jenkins/Jenkinsfile index b765cba5bc..51f54b8879 100644 --- a/.ci/jenkins/Jenkinsfile +++ b/.ci/jenkins/Jenkinsfile @@ -66,4 +66,4 @@ pipeline { cleanWs() } } -} +} \ No newline at end of file diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index 4d4cca2928..1947593ad4 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -315,4 +315,4 @@ String getReleaseGpgSignPassphraseCredsId() { String getGitTagName() { return params.GIT_TAG_NAME -} +} \ No newline at end of file diff --git a/.ci/jenkins/Jenkinsfile.promote b/.ci/jenkins/Jenkinsfile.promote index 2fb1959336..c1c0ba9d58 100644 --- a/.ci/jenkins/Jenkinsfile.promote +++ b/.ci/jenkins/Jenkinsfile.promote @@ -251,4 +251,4 @@ boolean isNotTestingBuild() { boolean isMainStream() { return env.DROOLS_STREAM == 'main' -} +} \ No newline at end of file diff --git a/.ci/jenkins/Jenkinsfile.setup-branch b/.ci/jenkins/Jenkinsfile.setup-branch index a26ad8be5b..1bc66b5006 100644 --- a/.ci/jenkins/Jenkinsfile.setup-branch +++ b/.ci/jenkins/Jenkinsfile.setup-branch @@ -166,4 +166,4 @@ boolean isMainBranch() { boolean isMainStream() { return env.DROOLS_STREAM == 'main' -} +} \ No newline at end of file diff --git a/.ci/jenkins/Jenkinsfile.weekly.deploy b/.ci/jenkins/Jenkinsfile.weekly.deploy index 9f941f80f3..318a5215dc 100644 --- a/.ci/jenkins/Jenkinsfile.weekly.deploy +++ b/.ci/jenkins/Jenkinsfile.weekly.deploy @@ -238,4 +238,4 @@ String getProjectVersion(boolean keepSnapshotSuffix = true) { return projectVersion.replace("-SNAPSHOT", "-${getProjectVersionDate()}-SNAPSHOT") } return projectVersion.replace("-SNAPSHOT", "-${getProjectVersionDate()}") -} +} \ No newline at end of file diff --git a/.ci/jenkins/config/branch.yaml b/.ci/jenkins/config/branch.yaml index faa0c628e1..efda8a7ad7 100644 --- a/.ci/jenkins/config/branch.yaml +++ b/.ci/jenkins/config/branch.yaml @@ -11,20 +11,20 @@ environments: DROOLS_BUILD_MVN_OPTS: -Dfull ADDITIONAL_TIMEOUT: 720 ids: - - native + - native sonarcloud: auto_generation: false env_vars: ENABLE_SONARCLOUD: true DROOLS_BUILD_MVN_OPTS: -Dfull ids: - - sonarcloud - - coverage + - sonarcloud + - coverage repositories: -- name: incubator-kie-drools - job_display_name: drools - branch: 10.1.x - is_branch_config_repo: true + - name: incubator-kie-drools + job_display_name: drools + branch: 10.1.x + is_branch_config_repo: true git: author: name: apache @@ -79,8 +79,8 @@ cloud: release: gpg: sign: - key-credentials-id: GPG_KEY_FILE - passphrase-credentials-id: '' + key_credentials_id: GPG_KEY_FILE + passphrase_credentials_id: '' jenkins: email_creds_id: DROOLS_CI_NOTIFICATION_EMAILS agent: @@ -91,4 +91,4 @@ jenkins: default_tools: jdk: jdk_17_latest maven: maven_3.9.6 - sonar_jdk: jdk_17_latest + sonar_jdk: jdk_17_latest \ No newline at end of file diff --git a/.ci/jenkins/config/main.yaml b/.ci/jenkins/config/main.yaml index eb294171dd..6cbdd3f1aa 100644 --- a/.ci/jenkins/config/main.yaml +++ b/.ci/jenkins/config/main.yaml @@ -1,22 +1,41 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + ecosystem: main_project: drools projects: - - name: drools - regexs: - - drools.* - - incubator-kie-drools.* - - name: kie-benchmarks - ignore_release: true - regexs: - - kie-benchmarks.* - - incubator-kie-benchmarks.* + - name: drools + regexs: + - drools.* + - incubator-kie-drools.* + - name: kie-benchmarks + ignore_release: true + regexs: + - kie-benchmarks.* + - incubator-kie-benchmarks.* git: branches: - - name: main - main_branch: true - - name: 10.0.x - seed: - branch: seed-drools-10.0.x + - name: main + main_branch: true + - name: 10.0.x + seed: + branch: seed-drools-10.0.x seed: config_file: git: @@ -34,5 +53,8 @@ jenkins: agent: docker: builder: + # At some point, this image will need to be changed when a release branch is created + # but we need to make sure the image exists first ... simple tag before setting up the branch ? + # See https://github.com/kiegroup/kie-issues/issues/551 image: docker.io/apache/incubator-kie-kogito-ci-build:main-latest - args: --privileged --group-add docker + args: --privileged --group-add docker \ No newline at end of file diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy index 131579fbdb..8f3a89459e 100644 --- a/.ci/jenkins/dsl/jobs.groovy +++ b/.ci/jenkins/dsl/jobs.groovy @@ -70,12 +70,12 @@ KogitoJobUtils.createMainQuarkusUpdateToolsJob(this, void createProjectSetupBranchJob() { def jobParams = JobParamsUtils.getBasicJobParams(this, '0-setup-branch', JobType.SETUP_BRANCH, "${jenkins_path_project}/Jenkinsfile.setup-branch", 'Drools Setup Branch') jobParams.env.putAll([ - JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", + JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", - GIT_BRANCH_NAME: "${GIT_BRANCH}", + GIT_BRANCH_NAME: "${GIT_BRANCH}", - IS_MAIN_BRANCH: "${Utils.isMainBranch(this)}", - DROOLS_STREAM: Utils.getStream(this), + IS_MAIN_BRANCH: "${Utils.isMainBranch(this)}", + DROOLS_STREAM: Utils.getStream(this), ]) KogitoJobTemplate.createPipelineJob(this, jobParams)?.with { parameters { @@ -89,11 +89,11 @@ void setupProjectNightlyJob() { def jobParams = JobParamsUtils.getBasicJobParams(this, '0-nightly', JobType.NIGHTLY, "${jenkins_path_project}/Jenkinsfile.nightly", 'Drools Nightly') jobParams.triggers = [cron : isMainStream() ? '@midnight' : 'H 3 * * *'] jobParams.env.putAll([ - JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", + JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", - GIT_BRANCH_NAME: "${GIT_BRANCH}", + GIT_BRANCH_NAME: "${GIT_BRANCH}", - DROOLS_STREAM: Utils.getStream(this), + DROOLS_STREAM: Utils.getStream(this), ]) KogitoJobTemplate.createPipelineJob(this, jobParams)?.with { parameters { @@ -104,13 +104,13 @@ void setupProjectNightlyJob() { void setupProjectWeeklyJob() { def jobParams = JobParamsUtils.getBasicJobParams(this, '0-weekly', JobType.OTHER, "${jenkins_path_project}/Jenkinsfile.weekly", 'Drools Weekly') - jobParams.triggers = [cron : '0 2 * * 0'] + jobParams.triggers = [cron : '0 3 * * 0'] jobParams.env.putAll([ - JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", + JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", - GIT_BRANCH_NAME: "${GIT_BRANCH}", + GIT_BRANCH_NAME: "${GIT_BRANCH}", - DROOLS_STREAM: Utils.getStream(this), + DROOLS_STREAM: Utils.getStream(this), ]) KogitoJobTemplate.createPipelineJob(this, jobParams)?.with { parameters { @@ -122,21 +122,18 @@ void setupProjectWeeklyJob() { void setupProjectReleaseJob() { def jobParams = JobParamsUtils.getBasicJobParams(this, '0-drools-release', JobType.RELEASE, "${jenkins_path_project}/Jenkinsfile.release", 'Drools/Kogito Artifacts Release') jobParams.env.putAll([ - JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", + JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", - GIT_BRANCH_NAME: "${GIT_BRANCH}", - GIT_AUTHOR: "${GIT_AUTHOR_NAME}", - - DEFAULT_STAGING_REPOSITORY: "${MAVEN_NEXUS_STAGING_PROFILE_URL}", - ARTIFACTS_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}", - - DROOLS_STREAM: Utils.getStream(this), + GIT_BRANCH_NAME: "${GIT_BRANCH}", + GIT_AUTHOR: "${GIT_AUTHOR_NAME}", ]) KogitoJobTemplate.createPipelineJob(this, jobParams)?.with { parameters { stringParam('RESTORE_FROM_PREVIOUS_JOB', '', 'URL to a previous stopped release job which needs to be continued') - stringParam('DROOLS_VERSION', '', 'Drools version to release as Major.minor.micro') + stringParam('RELEASE_VERSION', '', 'Drools version to release as Major.minor.micro') + + stringParam('GIT_TAG_NAME', '', 'Git tag to create. i.e.: 10.0.0-rc1') booleanParam('SKIP_TESTS', false, 'Skip all tests') } @@ -147,14 +144,14 @@ void setupProjectPostReleaseJob() { def jobParams = JobParamsUtils.getBasicJobParams(this, 'drools-post-release', JobType.RELEASE, "${jenkins_path_project}/Jenkinsfile.post-release", 'Drools Post Release') JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams) jobParams.env.putAll([ - JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", + JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", - GIT_BRANCH_NAME: "${GIT_BRANCH}", - GIT_AUTHOR: "${GIT_AUTHOR_NAME}", - GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}", - GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}", + GIT_BRANCH_NAME: "${GIT_BRANCH}", + GIT_AUTHOR: "${GIT_AUTHOR_NAME}", + GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}", + GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}", - DROOLS_STREAM: Utils.getStream(this), + DROOLS_STREAM: Utils.getStream(this), ]) KogitoJobTemplate.createPipelineJob(this, jobParams)?.with { parameters { @@ -171,47 +168,47 @@ void setupProjectPostReleaseJob() { Map getMultijobPRConfig(JenkinsFolder jobFolder) { def jobConfig = [ - parallel: true, - buildchain: true, - jobs : [ - [ - id: 'drools', - primary: true, - env : [ - // Sonarcloud analysis only on main branch - // As we have only Community edition - ENABLE_SONARCLOUD: EnvUtils.isDefaultEnvironment(this, jobFolder.getEnvironmentName()) && Utils.isMainBranch(this), - ] - ], [ - id: 'kogito-runtimes', - repository: 'incubator-kie-kogito-runtimes' - ], [ - id: 'kogito-apps', - repository: 'incubator-kie-kogito-apps', - ], [ - id: 'kogito-quarkus-examples', - repository: 'incubator-kie-kogito-examples', - env : [ - KOGITO_EXAMPLES_SUBFOLDER_POM: 'kogito-quarkus-examples/', - ], - ], [ - id: 'kogito-springboot-examples', - repository: 'incubator-kie-kogito-examples', - env : [ - KOGITO_EXAMPLES_SUBFOLDER_POM: 'kogito-springboot-examples/', - ], - ], [ - id: 'serverless-workflow-examples', - repository: 'incubator-kie-kogito-examples', - env : [ - KOGITO_EXAMPLES_SUBFOLDER_POM: 'serverless-workflow-examples/', - ], - // Commented as not migrated - // ], [ - // id: 'kie-jpmml-integration', - // repository: 'incubator-kie-jpmml-integration' + parallel: true, + buildchain: true, + jobs : [ + [ + id: 'drools', + primary: true, + env : [ + // Sonarcloud analysis only on main branch + // As we have only Community edition + ENABLE_SONARCLOUD: EnvUtils.isDefaultEnvironment(this, jobFolder.getEnvironmentName()) && Utils.isMainBranch(this), + ] + ], [ + id: 'kogito-runtimes', + repository: 'incubator-kie-kogito-runtimes' + ], [ + id: 'kogito-apps', + repository: 'incubator-kie-kogito-apps', + ], [ + id: 'kogito-quarkus-examples', + repository: 'incubator-kie-kogito-examples', + env : [ + KOGITO_EXAMPLES_SUBFOLDER_POM: 'kogito-quarkus-examples/', + ], + ], [ + id: 'kogito-springboot-examples', + repository: 'incubator-kie-kogito-examples', + env : [ + KOGITO_EXAMPLES_SUBFOLDER_POM: 'kogito-springboot-examples/', + ], + ], [ + id: 'serverless-workflow-examples', + repository: 'incubator-kie-kogito-examples', + env : [ + KOGITO_EXAMPLES_SUBFOLDER_POM: 'serverless-workflow-examples/', + ], + // Commented as not migrated + // ], [ + // id: 'kie-jpmml-integration', + // repository: 'incubator-kie-jpmml-integration' + ] ] - ] ] // For Quarkus 3, run only drools PR check... for now @@ -259,9 +256,9 @@ setupWeeklyDeployJob() // Tools job if (isMainStream()) { KogitoJobUtils.createQuarkusUpdateToolsJob(this, 'drools', [ - modules: [ 'drools-build-parent' ], - compare_deps_remote_poms: [ 'io.quarkus:quarkus-bom' ], - properties: [ 'version.io.quarkus' ], + modules: [ 'drools-build-parent' ], + compare_deps_remote_poms: [ 'io.quarkus:quarkus-bom' ], + properties: [ 'version.io.quarkus' ], ]) } @@ -281,16 +278,16 @@ void createSetupBranchJob() { def jobParams = JobParamsUtils.getBasicJobParams(this, 'drools', JobType.SETUP_BRANCH, "${jenkins_path}/Jenkinsfile.setup-branch", 'Drools Setup branch') JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams) jobParams.env.putAll([ - JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", + JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", - GIT_AUTHOR: "${GIT_AUTHOR_NAME}", - GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}", - GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}", + GIT_AUTHOR: "${GIT_AUTHOR_NAME}", + GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}", + GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}", - MAVEN_SETTINGS_CONFIG_FILE_ID: Utils.getMavenSettingsConfigFileId(this, JobType.NIGHTLY.name), + MAVEN_SETTINGS_CONFIG_FILE_ID: Utils.getMavenSettingsConfigFileId(this, JobType.NIGHTLY.name), - IS_MAIN_BRANCH: "${Utils.isMainBranch(this)}", - DROOLS_STREAM: Utils.getStream(this), + IS_MAIN_BRANCH: "${Utils.isMainBranch(this)}", + DROOLS_STREAM: Utils.getStream(this), ]) KogitoJobTemplate.createPipelineJob(this, jobParams)?.with { parameters { @@ -309,22 +306,22 @@ void setupDeployJob() { def jobParams = JobParamsUtils.getBasicJobParams(this, 'drools-deploy', JobType.RELEASE, "${jenkins_path}/Jenkinsfile.deploy", 'Drools Deploy') JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams) jobParams.env.putAll([ - PROPERTIES_FILE_NAME: 'deployment.properties', - JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", + PROPERTIES_FILE_NAME: 'deployment.properties', + JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", - GIT_AUTHOR: "${GIT_AUTHOR_NAME}", - GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}", - GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}", + GIT_AUTHOR: "${GIT_AUTHOR_NAME}", + GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}", + GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}", - MAVEN_SETTINGS_CONFIG_FILE_ID: Utils.getMavenSettingsConfigFileId(this, JobType.RELEASE.name), - MAVEN_DEPENDENCIES_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}", - MAVEN_DEPLOY_REPOSITORY: Utils.getMavenArtifactsUploadRepositoryUrl(this, JobType.RELEASE.name), - MAVEN_REPO_CREDS_ID: Utils.getMavenArtifactsUploadRepositoryCredentialsId(this, JobType.RELEASE.name), + MAVEN_SETTINGS_CONFIG_FILE_ID: Utils.getMavenSettingsConfigFileId(this, JobType.RELEASE.name), + MAVEN_DEPENDENCIES_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}", + MAVEN_DEPLOY_REPOSITORY: Utils.getMavenArtifactsUploadRepositoryUrl(this, JobType.RELEASE.name), + MAVEN_REPO_CREDS_ID: Utils.getMavenArtifactsUploadRepositoryCredentialsId(this, JobType.RELEASE.name), - DROOLS_STREAM: Utils.getStream(this), + DROOLS_STREAM: Utils.getStream(this), - RELEASE_GPG_SIGN_KEY_CREDS_ID: Utils.getReleaseGpgSignKeyCredentialsId(this), - RELEASE_GPG_SIGN_PASSPHRASE_CREDS_ID: Utils.getReleaseGpgSignPassphraseCredentialsId(this) + RELEASE_GPG_SIGN_KEY_CREDS_ID: Utils.getReleaseGpgSignKeyCredentialsId(this), + RELEASE_GPG_SIGN_PASSPHRASE_CREDS_ID: Utils.getReleaseGpgSignPassphraseCredentialsId(this) ]) KogitoJobTemplate.createPipelineJob(this, jobParams)?.with { parameters { @@ -338,6 +335,8 @@ void setupDeployJob() { stringParam('PROJECT_VERSION', '', 'Optional if not RELEASE. If RELEASE, cannot be empty.') stringParam('DROOLS_PR_BRANCH', '', 'PR branch name') + stringParam('GIT_TAG_NAME', '', 'Optional if not RELEASE. Tag to be created in the repository') + booleanParam('SEND_NOTIFICATION', false, 'In case you want the pipeline to send a notification on CI channel for this run.') } } @@ -347,18 +346,18 @@ void setupPromoteJob() { def jobParams = JobParamsUtils.getBasicJobParams(this, 'drools-promote', JobType.RELEASE, "${jenkins_path}/Jenkinsfile.promote", 'Drools Promote') JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams) jobParams.env.putAll([ - PROPERTIES_FILE_NAME: 'deployment.properties', - JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", + PROPERTIES_FILE_NAME: 'deployment.properties', + JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", - GIT_AUTHOR: "${GIT_AUTHOR_NAME}", - GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}", - GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}", + GIT_AUTHOR: "${GIT_AUTHOR_NAME}", + GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}", + GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}", - MAVEN_SETTINGS_CONFIG_FILE_ID: Utils.getMavenSettingsConfigFileId(this, JobType.RELEASE.name), - MAVEN_DEPENDENCIES_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}", - MAVEN_DEPLOY_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}", + MAVEN_SETTINGS_CONFIG_FILE_ID: Utils.getMavenSettingsConfigFileId(this, JobType.RELEASE.name), + MAVEN_DEPENDENCIES_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}", + MAVEN_DEPLOY_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}", - DROOLS_STREAM: Utils.getStream(this), + DROOLS_STREAM: Utils.getStream(this), ]) KogitoJobTemplate.createPipelineJob(this, jobParams)?.with { parameters { @@ -378,19 +377,19 @@ void setupWeeklyDeployJob() { def jobParams = JobParamsUtils.getBasicJobParams(this, 'drools.weekly-deploy', JobType.OTHER, "${jenkins_path}/Jenkinsfile.weekly.deploy", 'Drools Weekly Deploy') JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams) jobParams.env.putAll([ - PROPERTIES_FILE_NAME: 'deployment.properties', - JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", + PROPERTIES_FILE_NAME: 'deployment.properties', + JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", - GIT_AUTHOR: "${GIT_AUTHOR_NAME}", - GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}", - GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}", + GIT_AUTHOR: "${GIT_AUTHOR_NAME}", + GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}", + GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}", - MAVEN_SETTINGS_CONFIG_FILE_ID: Utils.getMavenSettingsConfigFileId(this, JobType.NIGHTLY.name), - MAVEN_DEPENDENCIES_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}", - MAVEN_DEPLOY_REPOSITORY: Utils.getMavenArtifactsUploadRepositoryUrl(this, JobType.NIGHTLY.name), - MAVEN_REPO_CREDS_ID: Utils.getMavenArtifactsUploadRepositoryCredentialsId(this, JobType.NIGHTLY.name), + MAVEN_SETTINGS_CONFIG_FILE_ID: Utils.getMavenSettingsConfigFileId(this, JobType.NIGHTLY.name), + MAVEN_DEPENDENCIES_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}", + MAVEN_DEPLOY_REPOSITORY: Utils.getMavenArtifactsUploadRepositoryUrl(this, JobType.NIGHTLY.name), + MAVEN_REPO_CREDS_ID: Utils.getMavenArtifactsUploadRepositoryCredentialsId(this, JobType.NIGHTLY.name), - DROOLS_STREAM: Utils.getStream(this), + DROOLS_STREAM: Utils.getStream(this), ]) KogitoJobTemplate.createPipelineJob(this, jobParams)?.with { parameters { @@ -405,4 +404,4 @@ void setupWeeklyDeployJob() { booleanParam('SEND_NOTIFICATION', false, 'In case you want the pipeline to send a notification on CI channel for this run.') } } -} +} \ No newline at end of file diff --git a/.ci/jenkins/project/Jenkinsfile.nightly b/.ci/jenkins/project/Jenkinsfile.nightly index f5e41fd585..4391733ce5 100644 --- a/.ci/jenkins/project/Jenkinsfile.nightly +++ b/.ci/jenkins/project/Jenkinsfile.nightly @@ -187,4 +187,4 @@ void addBooleanParam(List buildParams, String key, boolean value) { String getBuildBranch() { return env.GIT_BRANCH_NAME -} +} \ No newline at end of file diff --git a/.ci/jenkins/project/Jenkinsfile.release b/.ci/jenkins/project/Jenkinsfile.release index 030dbeb6b7..1287fe191f 100644 --- a/.ci/jenkins/project/Jenkinsfile.release +++ b/.ci/jenkins/project/Jenkinsfile.release @@ -54,22 +54,17 @@ pipeline { echo "Release properties imported from previous job: ${releaseProperties}" } - assert getDroolsVersion() + assert getReleaseVersion() currentBuild.displayName = getDisplayName() - sendNotification("Release Pipeline has started...\nDrools version = ${getDroolsVersion()}\n=> ${env.BUILD_URL}") - - // Safety measure to not publish to main JBoss - if (getGitAuthor() != 'apache' && !getArtifactsRepositoryParam()) { - sendNotification("Git Author is different from `apache` and no `ARTIFACTS_REPOSITORY` parameter has been provided. Are you sure you want to continue ? => ${env.BUILD_URL}input") - input message: 'Should the pipeline continue with no `ARTIFACTS_REPOSITORY` defined ?', ok: 'Yes' - } + sendNotification("Release Pipeline has started...\nDrools version = ${getReleaseVersion()}\n=> ${env.BUILD_URL}") } } post { always { - setReleasePropertyIfneeded('drools.version', getDroolsVersion()) + setReleasePropertyIfneeded('release.version', getReleaseVersion()) + setReleasePropertyIfneeded('git.tag.name', getGitTagName()) } } } @@ -79,89 +74,21 @@ pipeline { script { def buildParams = getDefaultBuildParams() addSkipTestsParam(buildParams) - buildJob(getDeployJobName(droolsRepo), buildParams) } } } - // stage('Build & Deploy KIE jpmml integration') { - // steps { - // script { - // def buildParams = getDefaultBuildParams() - // addSkipTestsParam(buildParams) - - // buildJob(getDeployJobName(kieJpmmlIntegrationRepo), buildParams) - // } - // } - // } - stage('Artifacts\' staging finalization') { steps { script { if (!areArtifactsStaged()) { - sendNotification("All artifacts have been staged. You can find them here: ${getStagingRepository()}") + sendNotification('All artifacts have been staged.') } setArtifactsStaged() } } } - - stage('Are staged artifacts released?') { - when { - // Execute only if artifacts repository was not given, which means the staging repository has been created - expression { return !getArtifactsRepositoryParam() && !areArtifactsReleased() } - } - steps { - script { - String body = "${getDroolsVersion()} artifacts are ready for release.\n" + - "Please release the staging repositories and then confirm here: ${env.BUILD_URL}input" - sendNotification(body) - input message: 'Has the staging repository been released ?', ok: 'Yes' - - sendNotification('Artifacts have been released. Finalizing now the release ...') - setArtifactsReleased() - } - } - } - - stage('Promote Drools') { - when { - expression { return isJobConsideredOk(getDeployJobName(droolsRepo)) } - } - steps { - script { - def buildParams = getDefaultBuildParams() - addDeployBuildUrlParam(buildParams, getDeployJobName(droolsRepo)) - - buildJob(getPromoteJobName(droolsRepo), buildParams) - } - } - } - - // stage('Promote KIE jpmml integration') { - // when { - // expression { return isJobConsideredOk(getDeployJobName(kieJpmmlIntegrationRepo)) } - // } - // steps { - // script { - // def buildParams = getDefaultBuildParams() - // addDeployBuildUrlParam(buildParams, getDeployJobName(kieJpmmlIntegrationRepo)) - - // buildJob(getPromoteJobName(kieJpmmlIntegrationRepo), buildParams) - // } - // } - // } - - stage('Setup next snapshot version') { - steps { - script { - def buildParams = [] - addStringParam(buildParams, 'DROOLS_VERSION', util.getNextVersion(getDroolsVersion(), 'micro')) - build(job: '../setup-branch/0-setup-branch', wait: false, parameters: buildParams, propagate: false) - } - } - } } post { always { @@ -232,10 +159,6 @@ String getDeployJobName(String repository) { return "${repository}-deploy" } -String getPromoteJobName(String repository) { - return "${repository}-promote" -} - String getJobPropertySuffix(String jobName) { return "${JOB_PROPERTY_PREFIX}.${jobName}" } @@ -330,9 +253,10 @@ def readPropertiesFromUrl(String url, String propsFilename) { List getDefaultBuildParams() { List buildParams = [] - addDisplayNameParam(buildParams, getDisplayName(getDroolsVersion())) - addStringParam(buildParams, 'PROJECT_VERSION', getDroolsVersion()) - addStringParam(buildParams, 'DROOLS_PR_BRANCH', "drools-${getDroolsVersion()}") + addDisplayNameParam(buildParams, getDisplayName(getReleaseVersion())) + addStringParam(buildParams, 'PROJECT_VERSION', getReleaseVersion()) + addStringParam(buildParams, 'DROOLS_PR_BRANCH', "drools-${getReleaseVersion()}") + addStringParam(buildParams, 'GIT_TAG_NAME', getGitTagName()) return buildParams } @@ -367,26 +291,18 @@ void addBooleanParam(List buildParams, String key, boolean value) { } String getDisplayName(version = '') { - version = version ?: getDroolsVersion() + version = version ?: getReleaseVersion() return "Release ${version}" } -String getDroolsVersion() { - return params.DROOLS_VERSION ?: getReleaseProperty('drools.version') +String getReleaseVersion() { + return params.RELEASE_VERSION ?: getReleaseProperty('release.version') } String getGitAuthor() { return env.GIT_AUTHOR } -String getArtifactsRepositoryParam() { - return env['ARTIFACTS_REPOSITORY'] ?: '' -} - -String getStagingRepository() { - return getArtifactsRepositoryParam() ?: env.DEFAULT_STAGING_REPOSITORY -} - void setReleasePropertyIfneeded(String key, def value) { if (value) { releaseProperties[key] = value @@ -415,10 +331,6 @@ void setArtifactsStaged() { setReleasePropertyIfneeded(ARTIFACTS_STAGING_STAGE, true) } -boolean areArtifactsReleased() { - return hasReleaseProperty(ARTIFACTS_RELEASE_STAGE) -} - -void setArtifactsReleased() { - setReleasePropertyIfneeded(ARTIFACTS_RELEASE_STAGE, true) -} +String getGitTagName() { + return params.GIT_TAG_NAME ?: getReleaseProperty('git.tag.name') +} \ No newline at end of file diff --git a/.ci/jenkins/project/Jenkinsfile.setup-branch b/.ci/jenkins/project/Jenkinsfile.setup-branch index e50bd30b4d..4a6a18c46b 100644 --- a/.ci/jenkins/project/Jenkinsfile.setup-branch +++ b/.ci/jenkins/project/Jenkinsfile.setup-branch @@ -225,4 +225,4 @@ String getVersionFromReleaseBranch(String releaseBranch, int microVersion = 999, } else { error 'Cannot parse given branch as a release branch, aka [M].[m].x ...' } -} +} \ No newline at end of file diff --git a/.ci/jenkins/project/Jenkinsfile.weekly b/.ci/jenkins/project/Jenkinsfile.weekly index a3d5aeea3a..2a7e3322bd 100644 --- a/.ci/jenkins/project/Jenkinsfile.weekly +++ b/.ci/jenkins/project/Jenkinsfile.weekly @@ -180,4 +180,4 @@ String getCurrentDate() { String getCheckoutDatetime() { return getCurrentDate() + ' 02:00' // Cut-off 02:00AM -} +} \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
