Skip to content

Commit

Permalink
Add artifactiry info into the test job template (#1014)
Browse files Browse the repository at this point in the history
- add ARTIFACTORY_REPO and ARTIFACTORY_ROOT_DIR
- rename JENKINS_DOMAIN to ARTIFACTORY_ROOT_DIR in Jenkins base to avoid
confusion. This value defaults to jenkins domain, but it can be set to
other value.

Issue: eclipse-openj9/openj9#5198

Signed-off-by: lanxia <lan_xia@ca.ibm.com>
  • Loading branch information
llxia authored and Shelley Lambert committed Mar 21, 2019
1 parent 357625c commit 1d3e11f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions buildenv/jenkins/JenkinsfileBase
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,8 @@ def uploadToArtifactory() {
if (params.ARTIFACTORY_SERVER) {
def server = Artifactory.server params.ARTIFACTORY_SERVER
def artifactoryRepo = params.ARTIFACTORY_REPO ? params.ARTIFACTORY_REPO : "sys-rt-generic-local"
def jenkinsDomain = params.JENKINS_DOMAIN ? params.JENKINS_DOMAIN : getJenkinsDomain()
def artifactoryUploadDir = "${artifactoryRepo}/${jenkinsDomain}/${JOB_NAME}/${BUILD_ID}/"
def artifactoryRoorDir = params.ARTIFACTORY_ROOT_DIR ? params.ARTIFACTORY_ROOT_DIR : getJenkinsDomain()
def artifactoryUploadDir = "${artifactoryRepo}/${artifactoryRoorDir}/${JOB_NAME}/${BUILD_ID}/"

def uploadSpec = """{
"files":[
Expand Down
4 changes: 4 additions & 0 deletions buildenv/jenkins/testJobTemplate
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

if (!binding.hasVariable('JDK_IMPL')) JDK_IMPL = "openj9"
if (!binding.hasVariable('ARTIFACTORY_SERVER')) ARTIFACTORY_SERVER = ""
if (!binding.hasVariable('ARTIFACTORY_REPO')) ARTIFACTORY_REPO = ""
if (!binding.hasVariable('ARTIFACTORY_ROOT_DIR')) ARTIFACTORY_ROOT_DIR = ""
if (!binding.hasVariable('TIME_LIMIT')) TIME_LIMIT = "10"
if (!binding.hasVariable('SUFFIX')) SUFFIX = ""
if (!binding.hasVariable('BUILDS_TO_KEEP')) {
Expand Down Expand Up @@ -135,6 +137,8 @@ SPECS.each { SPEC ->
stringParam('SSH_AGENT_CREDENTIAL', "", "Optional. Only use when ssh credentials are needed")
booleanParam('KEEP_WORKSPACE', false, "Keep workspace on the machine")
stringParam('ARTIFACTORY_SERVER', ARTIFACTORY_SERVER, "Optional. Default is to upload test output (failed build) onto artifactory only. By unset this value, test output will be archived to Jenkins")
stringParam('ARTIFACTORY_REPO', ARTIFACTORY_REPO, "Optional. It should be used with ARTIFACTORY_SERVER")
stringParam('ARTIFACTORY_ROOT_DIR', ARTIFACTORY_ROOT_DIR, "Optional. It should be used with ARTIFACTORY_SERVER and ARTIFACTORY_REPO. Default is to set root dir to be the same as the current Jenkins domain")
booleanParam('PERSONAL_BUILD', false, "Is this a personal build?")
booleanParam('IS_PARALLEL', false, "Should tests run in parallel?")
stringParam('USER_CREDENTIALS_ID', "", "Optional. User credential ID")
Expand Down

0 comments on commit 1d3e11f

Please sign in to comment.