Skip to content

Commit

Permalink
[10.0.x] CI duplicate maven configuration entries (apache#3133)
Browse files Browse the repository at this point in the history
Co-authored-by: jstastny-cz <jan.stastny@ibm.com>
  • Loading branch information
jstastny-cz and jstastny-cz committed Oct 18, 2024
1 parent 78d8408 commit 1310edb
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 20 deletions.
14 changes: 11 additions & 3 deletions .ci/jenkins/config/branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
30 changes: 15 additions & 15 deletions .ci/jenkins/dsl/jobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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}",
])
Expand Down Expand Up @@ -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}"
])
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -238,7 +238,7 @@ setupSpecificBuildChainNightlyJob('native')

// Release jobs
setupDeployJob(JobType.RELEASE)
setupPromoteJob(JobType.RELEASE)
setupPromoteJob()

// Weekly deploy job
setupWeeklyDeployJob()
Expand Down Expand Up @@ -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}"
Expand Down Expand Up @@ -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),

Expand All @@ -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,
Expand Down Expand Up @@ -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}",
Expand All @@ -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}",

Expand Down Expand Up @@ -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 {
Expand All @@ -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),
])
Expand Down
4 changes: 2 additions & 2 deletions .ci/jenkins/dsl/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1310edb

Please sign in to comment.