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

Add configuration parameter to disable nexus deploy #1088

Merged
merged 1 commit into from
Sep 19, 2023
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
1 change: 1 addition & 0 deletions .ci/jenkins/config/branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ environments:
- ecosystem
disable:
triggers: true # TODO to set back
deploy: true
repositories:
- name: incubator-kie-kogito-pipelines
job_display_name: kogito-pipelines
Expand Down
4 changes: 4 additions & 0 deletions dsl/seed/src/main/groovy/org/kie/jenkins/jobdsl/Utils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -275,4 +275,8 @@ class Utils {
return words.collect { it.isEmpty() ? it : it.substring(0, 1).toUpperCase() + it.substring(1).toLowerCase() }.join(' ')
}

static boolean isDeployDisabled(def script) {
return getBindingValue(script, 'DISABLE_DEPLOY').toBoolean() || isTestEnvironment(script)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class JobParamsUtils {

static def setupJobParamsDeployConfiguration(def script, def jobParams) {
jobParams.env = jobParams.env ?: [:]
jobParams.env.put('ENABLE_DEPLOY', 'true')
jobParams.env.put('ENABLE_DEPLOY', String.valueOf(!Utils.isDeployDisabled(script)))
addJobParamsEnvIfNotExisting(script, jobParams, 'MAVEN_DEPLOY_REPOSITORY', Utils.getMavenArtifactsUploadRepositoryUrl(script))
addJobParamsEnvIfNotExisting(script, jobParams, 'MAVEN_DEPLOY_REPOSITORY_CREDS_ID', Utils.getMavenArtifactsUploadRepositoryCredentialsId(script))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class SeedJobUtils {
definition {
cps {
script(jenkinsScript.readFileFromWorkspace('jenkinsfiles/Jenkinsfile.seed.trigger'))
sandbox()
}
}

Expand Down