Skip to content

Commit

Permalink
Update customUrl to dynamically use Jenkins domain
Browse files Browse the repository at this point in the history
- Dynamically build the customUrl using the extracted domain using getJenkinsDomain()

resolves:adoptium#5286

Signed-off-by: Anna Babu Palathingal <anna.bp@ibm.com>
  • Loading branch information
annaibm committed May 7, 2024
1 parent 9639787 commit b892202
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions buildenv/jenkins/JenkinsfileBase
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,13 @@ def setupParallelEnv() {
// check for each lib. If lib does not exist, donwload it.
// If lib exists, SHA will be checked. Re-download if SHA does not match.
timeout(time: 20, unit: 'MINUTES') {
def customUrl = "https://ci.adoptium.net/job/test.getDependency/lastSuccessfulBuild/artifact/"
def jenkinsDomain = getJenkinsDomain()
jenkinsDomain = jenkinsDomain.replaceAll("/+$", "")
if (jenkinsDomain.contains("hyc-runtimes")) {
jenkinsDomain = "openj9-jenkins.osuosl.org"
}
def customUrl = "https://${jenkinsDomain}/job/test.getDependency/lastSuccessfulBuild/artifact/"
echo "Custom URL: ${customUrl}"
if (PLATFORM.contains("windows")) {
env.LIB_DIR = env.LIB_DIR.replaceAll("\\\\", "/")
}
Expand Down Expand Up @@ -315,7 +321,7 @@ def setupParallelEnv() {

}

// Returns NUM_LIST from parallelList.mk.
// Returns NUM_LIST from parallelList.mk.
// NUM_LIST can be different than numOfMachines.
def genParallelList(PARALLEL_OPTIONS) {
String unsetLLP = ""
Expand Down Expand Up @@ -415,7 +421,7 @@ def setup() {
if (params.SDK_RESOURCE == 'nightly') {
// remove single quote to allow variables to be set in CUSTOMIZED_SDK_URL
CUSTOMIZED_SDK_URL_OPTION = "-c ${params.CUSTOMIZED_SDK_URL}"
} else if (!params.SDK_RESOURCE || params.SDK_RESOURCE == 'customized') {
} else if (!params.SDK_RESOURCE || params.SDK_RESOURCE == 'customized') {
SDK_RESOURCE = "customized"
CUSTOMIZED_SDK_URL_OPTION = "-c '${params.CUSTOMIZED_SDK_URL}'"
if (params.ADDITIONAL_ARTIFACTS_REQUIRED == "RI_JDK") {
Expand All @@ -437,7 +443,7 @@ def setup() {
error("SDK_RESOURCE: ${params.SDK_RESOURCE} and CUSTOMIZED_SDK_URL: ${params.CUSTOMIZED_SDK_URL} combo is not supported!")
}
} else {
if (params.SDK_RESOURCE == 'customized') {
if (params.SDK_RESOURCE == 'customized') {
error("SDK_RESOURCE: ${params.SDK_RESOURCE}, please provide CUSTOMIZED_SDK_URL")
} else {
CUSTOMIZED_SDK_URL_OPTION = ""
Expand Down Expand Up @@ -466,7 +472,7 @@ def setup() {
if (CLONE_OPENJ9_OPTION == "") {
if (env.BUILD_LIST.contains('functional')) {
CLONE_OPENJ9_OPTION = "--clone_openj9 true"
// If USE_TESTENV_PROPERTIES = false, set Openj9 repo and brnach.
// If USE_TESTENV_PROPERTIES = false, set Openj9 repo and brnach.
// Otherwise, testenv.properties will be used.
// And the Openj9 repo and brnach values will be set in get.sh
if(!params.USE_TESTENV_PROPERTIES) {
Expand Down Expand Up @@ -655,7 +661,13 @@ def buildTest() {
// check for each lib. If lib does not exist, donwload it.
// If lib exists, SHA will be checked. Re-download if SHA does not match.
timeout(time: 20, unit: 'MINUTES') {
def customUrl = "https://ci.adoptium.net/job/test.getDependency/lastSuccessfulBuild/artifact/"
def jenkinsDomain = getJenkinsDomain()
jenkinsDomain = jenkinsDomain.replaceAll("/+$", "")
if (jenkinsDomain.contains("hyc-runtimes")) {
jenkinsDomain = "openj9-jenkins.osuosl.org"
}
def customUrl = "https://${jenkinsDomain}/job/test.getDependency/lastSuccessfulBuild/artifact/"
echo "Custom URL: ${customUrl}"
if (PLATFORM.contains("windows")) {
env.LIB_DIR = env.LIB_DIR.replaceAll("\\\\", "/")
}
Expand Down

0 comments on commit b892202

Please sign in to comment.