Skip to content

Commit

Permalink
Jenkins: Add option to prefix Artifactory build names
Browse files Browse the repository at this point in the history
The internal Artifactory server is forcing us
touse a buildName prefix. This adds the option
to have a buildName prefix. However, we don't need
this at the OpenJ9 Jenkins farm so defaults.yml
sets the option to empty string.

Should be merged after eclipse-openj9#16102

Signed-off-by: Adam Brousseau <[email protected]>
  • Loading branch information
AdamBrousseau committed Oct 16, 2023
1 parent 85d65e0 commit b5cf282
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions buildenv/jenkins/common/build.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,10 @@ def upload_artifactory_core(geo, uploadSpec) {
// Add BUILD_IDENTIFIER to the buildInfo. The UploadSpec adds it to the Artifact info
buildInfo.env.filter.addInclude("BUILD_IDENTIFIER")
buildInfo.env.capture = true
if (ARTIFACTORY_CONFIG[geo]['buildNamePrefix'] != '') {
buildInfo.name = ARTIFACTORY_CONFIG[geo]['buildNamePrefix'] + '/' + JOB_NAME
}
println "buildInfo.name:$buildInfo.name"

//Retry uploading to Artifactory if errors occur
// Do not upload buildInfo if Server is behind a VPN as the Controller will not be able to talk to it.
Expand Down
1 change: 1 addition & 0 deletions buildenv/jenkins/common/variables-functions.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,7 @@ def set_basic_artifactory_config(id="Nightly") {
ARTIFACTORY_CONFIG[geo]['daysToKeepArtifacts'] = get_value(VARIABLES.artifactory.daysToKeepArtifacts, geo).toInteger()
ARTIFACTORY_CONFIG[geo]['manualCleanup'] = get_value(VARIABLES.artifactory.manualCleanup, geo)
ARTIFACTORY_CONFIG[geo]['vpn'] = get_value(VARIABLES.artifactory.vpn, geo)
ARTIFACTORY_CONFIG[geo]['buildNamePrefix'] = get_value(VARIABLES.artifactory.buildNamePrefix, geo)
}

/*
Expand Down
3 changes: 3 additions & 0 deletions buildenv/jenkins/variables/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ artifactory:
default: 'ci-openj9'
uploadDir:
default: "${repo}/${JOB_NAME}/${BUILD_ID}"
buildNamePrefix:
osu: ''
unb: ''
daysToKeepArtifacts:
osu: 40
unb: 30
Expand Down

0 comments on commit b5cf282

Please sign in to comment.