From 1e42c29cb15022fc33416006901c74a39ed80c58 Mon Sep 17 00:00:00 2001 From: Jan Stastny Date: Fri, 18 Oct 2024 11:22:28 +0200 Subject: [PATCH] [10.0.x] CI duplicate maven configuration entries (#6130) Co-authored-by: jstastny-cz --- .ci/jenkins/config/branch.yaml | 14 +++++++++++--- .ci/jenkins/dsl/jobs.groovy | 28 ++++++++++++++-------------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/.ci/jenkins/config/branch.yaml b/.ci/jenkins/config/branch.yaml index 2c6c8eac17dd..e777bb5efc97 100644 --- a/.ci/jenkins/config/branch.yaml +++ b/.ci/jenkins/config/branch.yaml @@ -77,7 +77,11 @@ buildchain_config: file_path: .ci/pull-request-config.yaml token_credentials_id: kie-ci3-token maven: - settings_file_id: kie-release-settings + settings: + nightly: + config_file_id: kie-nightly-settings + release: + config_file_id: kie-release-settings nexus: release_url: TO_DEFINE release_repository: TO_DEFINE @@ -86,8 +90,12 @@ maven: build_promotion_profile_id: TO_DEFINE artifacts_repository: '' artifacts_upload_repository: - url: https://repository.apache.org/content/repositories/snapshots - creds_id: apache-nexus-kie-deploy-credentials + nightly: + url: https://repository.apache.org/content/repositories/snapshots + creds_id: apache-nexus-kie-deploy-credentials + release: + url: https://repository.apache.org/service/local/staging/deploy/maven2 + creds_id: jenkins-deploy-to-nexus-staging cloud: image: registry_user_credentials_id: DOCKERHUB_USER diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy index 5e92426421de..85dc95cd6837 100644 --- a/.ci/jenkins/dsl/jobs.groovy +++ b/.ci/jenkins/dsl/jobs.groovy @@ -250,8 +250,8 @@ setupSpecificBuildChainNightlyJob('sonarcloud', setupSonarProjectKeyEnv(nightlyJ // Quarkus 3 nightly is exported to Kogito pipelines for easier integration // Release jobs -setupDeployJob(JobType.RELEASE) -setupPromoteJob(JobType.RELEASE) +setupDeployJob() +setupPromoteJob() // Weekly deploy job setupWeeklyDeployJob() @@ -287,7 +287,7 @@ void createSetupBranchJob() { GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}", GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}", - MAVEN_SETTINGS_CONFIG_FILE_ID: "${MAVEN_SETTINGS_FILE_ID}", + MAVEN_SETTINGS_CONFIG_FILE_ID: Utils.getMavenSettingsConfigFileId(this, JobType.NIGHTLY.name), IS_MAIN_BRANCH: "${Utils.isMainBranch(this)}", DROOLS_STREAM: Utils.getStream(this), @@ -305,8 +305,8 @@ void createSetupBranchJob() { } } -void setupDeployJob(JobType jobType) { - def jobParams = JobParamsUtils.getBasicJobParams(this, 'drools-deploy', jobType, "${jenkins_path}/Jenkinsfile.deploy", 'Drools Deploy') +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', @@ -316,10 +316,10 @@ void setupDeployJob(JobType jobType) { GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}", GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}", - MAVEN_SETTINGS_CONFIG_FILE_ID: "${MAVEN_SETTINGS_FILE_ID}", + MAVEN_SETTINGS_CONFIG_FILE_ID: Utils.getMavenSettingsConfigFileId(this, JobType.RELEASE.name), MAVEN_DEPENDENCIES_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}", - MAVEN_DEPLOY_REPOSITORY: "${MAVEN_ARTIFACTS_UPLOAD_REPOSITORY_URL}", - MAVEN_REPO_CREDS_ID: "${MAVEN_ARTIFACTS_UPLOAD_REPOSITORY_CREDS_ID}", + MAVEN_DEPLOY_REPOSITORY: Utils.getMavenArtifactsUploadRepositoryUrl(this, JobType.RELEASE.name), + MAVEN_REPO_CREDS_ID: Utils.getMavenArtifactsUploadRepositoryCredentialsId(this, JobType.RELEASE.name), DROOLS_STREAM: Utils.getStream(this), @@ -343,8 +343,8 @@ void setupDeployJob(JobType jobType) { } } -void setupPromoteJob(JobType jobType) { - def jobParams = JobParamsUtils.getBasicJobParams(this, 'drools-promote', jobType, "${jenkins_path}/Jenkinsfile.promote", 'Drools Promote') +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', @@ -354,7 +354,7 @@ void setupPromoteJob(JobType jobType) { GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}", GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}", - MAVEN_SETTINGS_CONFIG_FILE_ID: "${MAVEN_SETTINGS_FILE_ID}", + MAVEN_SETTINGS_CONFIG_FILE_ID: Utils.getMavenSettingsConfigFileId(this, JobType.RELEASE.name), MAVEN_DEPENDENCIES_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}", MAVEN_DEPLOY_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}", @@ -385,10 +385,10 @@ void setupWeeklyDeployJob() { GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}", GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}", - MAVEN_SETTINGS_CONFIG_FILE_ID: "${MAVEN_SETTINGS_FILE_ID}", + MAVEN_SETTINGS_CONFIG_FILE_ID: Utils.getMavenSettingsConfigFileId(this, JobType.NIGHTLY.name), MAVEN_DEPENDENCIES_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}", - MAVEN_DEPLOY_REPOSITORY: "${MAVEN_ARTIFACTS_UPLOAD_REPOSITORY_URL}", - MAVEN_REPO_CREDS_ID: "${MAVEN_ARTIFACTS_UPLOAD_REPOSITORY_CREDS_ID}", + MAVEN_DEPLOY_REPOSITORY: Utils.getMavenArtifactsUploadRepositoryUrl(this, JobType.NIGHTLY.name), + MAVEN_REPO_CREDS_ID: Utils.getMavenArtifactsUploadRepositoryCredentialsId(this, JobType.NIGHTLY.name), DROOLS_STREAM: Utils.getStream(this), ])