diff --git a/.ci/jenkins/config/branch.yaml b/.ci/jenkins/config/branch.yaml index 0403272be83..ff86806cc06 100644 --- a/.ci/jenkins/config/branch.yaml +++ b/.ci/jenkins/config/branch.yaml @@ -66,7 +66,11 @@ buildchain_config: file_path: .ci/buildchain-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 @@ -75,8 +79,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 d189091f687..cb3731a4da4 100644 --- a/.ci/jenkins/dsl/jobs.groovy +++ b/.ci/jenkins/dsl/jobs.groovy @@ -75,7 +75,7 @@ void setupProjectDroolsJob(String droolsBranch) { JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", NOTIFICATION_JOB_NAME: 'Drools snapshot check', DROOLS_BRANCH: droolsBranch, - MAVEN_SETTINGS_CONFIG_FILE_ID: "${MAVEN_SETTINGS_FILE_ID}", + MAVEN_SETTINGS_CONFIG_FILE_ID: Utils.getMavenSettingsConfigFileId(this, JobType.NIGHTLY.name), GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}", ]) @@ -116,7 +116,7 @@ void setupProjectNightlyJob() { GIT_AUTHOR: "${GIT_AUTHOR_NAME}", GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}", - MAVEN_SETTINGS_CONFIG_FILE_ID: "${MAVEN_SETTINGS_FILE_ID}", + MAVEN_SETTINGS_CONFIG_FILE_ID: Utils.getMavenSettingsConfigFileId(this, JobType.NIGHTLY.name), ARTIFACTS_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}", OPTAPLANNER_LATEST_STREAM: "${GIT_MAIN_BRANCH}" ]) @@ -174,7 +174,7 @@ void setupProjectPostReleaseJob() { 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}", GITHUB_CLI_VERSION: '0.11.1', @@ -238,7 +238,7 @@ setupSpecificBuildChainNightlyJob('native') // Release jobs setupDeployJob(JobType.RELEASE) -setupPromoteJob(JobType.RELEASE) +setupPromoteJob() // Weekly deploy job setupWeeklyDeployJob() @@ -274,7 +274,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)}", OPTAPLANNER_LATEST_STREAM: "${GIT_MAIN_BRANCH}" @@ -304,7 +304,7 @@ void setupDeployJob(JobType jobType, String envName = '') { PROPERTIES_FILE_NAME: 'deployment.properties', JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", - MAVEN_SETTINGS_CONFIG_FILE_ID: "${MAVEN_SETTINGS_FILE_ID}", + MAVEN_SETTINGS_CONFIG_FILE_ID: Utils.getMavenSettingsConfigFileId(this, jobType.name), OPTAPLANNER_LATEST_STREAM: "${GIT_MAIN_BRANCH}", DISABLE_DEPLOY: Utils.isDeployDisabled(this), @@ -326,8 +326,8 @@ void setupDeployJob(JobType jobType, String envName = '') { 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.name), + MAVEN_REPO_CREDS_ID: Utils.getMavenArtifactsUploadRepositoryCredentialsId(this, jobType.name), OPERATOR_IMAGE_NAME: 'optaplanner-operator', MAX_REGISTRY_RETRIES: 3, @@ -371,8 +371,8 @@ void setupDeployJob(JobType jobType, String envName = '') { } } -void setupPromoteJob(JobType jobType) { - def jobParams = JobParamsUtils.getBasicJobParams(this, 'optaplanner-promote', jobType, "${jenkins_path}/Jenkinsfile.promote", 'Optaplanner Promote') +void setupPromoteJob() { + def jobParams = JobParamsUtils.getBasicJobParams(this, 'optaplanner-promote', JobType.RELEASE, "${jenkins_path}/Jenkinsfile.promote", 'Optaplanner Promote') JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams) jobParams.env.putAll([ JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", @@ -382,7 +382,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}", @@ -421,7 +421,7 @@ void setupOptaPlannerTurtleTestsJob(String constraintStreamImplType) { jobParams.env.putAll([ CONSTRAINT_STREAM_IMPL_TYPE: "${constraintStreamImplType}", JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", - MAVEN_SETTINGS_CONFIG_FILE_ID: "${MAVEN_SETTINGS_FILE_ID}", + MAVEN_SETTINGS_CONFIG_FILE_ID: Utils.getMavenSettingsConfigFileId(this, JobType.NIGHTLY.name), ]) jobParams.triggers = [ cron : 'H H * * 5' ] // Run every Friday. KogitoJobTemplate.createPipelineJob(this, jobParams)?.with { @@ -443,10 +443,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), DISABLE_DEPLOY: Utils.isDeployDisabled(this), ]) diff --git a/.ci/jenkins/dsl/test.sh b/.ci/jenkins/dsl/test.sh index cac6dc28bec..e534696a950 100755 --- a/.ci/jenkins/dsl/test.sh +++ b/.ci/jenkins/dsl/test.sh @@ -41,10 +41,10 @@ fi git_author="$(echo ${git_url} | awk -F"${git_server_url}" '{print $2}' | awk -F. '{print $1}' | awk -F/ '{print $1}')" -export DSL_DEFAULT_MAIN_CONFIG_FILE_REPO="${git_author}"/optaplanner +export DSL_DEFAULT_MAIN_CONFIG_FILE_REPO="${git_author}"/incubator-kie-optaplanner export DSL_DEFAULT_FALLBACK_MAIN_CONFIG_FILE_REPO=apache/incubator-kie-optaplanner export DSL_DEFAULT_MAIN_CONFIG_FILE_PATH=.ci/jenkins/config/main.yaml -export DSL_DEFAULT_BRANCH_CONFIG_FILE_REPO="${git_author}"/optaplanner +export DSL_DEFAULT_BRANCH_CONFIG_FILE_REPO="${git_author}"/incubator-kie-optaplanner file=$(mktemp) # For more usage of the script, use ./test.sh -h