Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.0.x] CI duplicate maven configuration entries #3133

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .ci/jenkins/config/branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,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 @@ -54,8 +58,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
Loading