Skip to content

Commit

Permalink
Add configuration parameter to disable nexus deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
jstastny-cz committed Sep 19, 2023
1 parent de0ca2b commit 1688b0c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
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

0 comments on commit 1688b0c

Please sign in to comment.