From b2a0d5aeb2d2767524146e38ac59206e06d86871 Mon Sep 17 00:00:00 2001 From: Lan Xia Date: Tue, 7 May 2024 09:25:42 -0400 Subject: [PATCH] Allow custom TKG repo and branch/sha/tag to be set Signed-off-by: Lan Xia --- buildenv/jenkins/getDependency | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/buildenv/jenkins/getDependency b/buildenv/jenkins/getDependency index c0b925e363..b44570a0ec 100644 --- a/buildenv/jenkins/getDependency +++ b/buildenv/jenkins/getDependency @@ -35,9 +35,19 @@ def testBuild() { archiveArtifacts '**/systemtest_prereqs/asm/asm.jar' archiveArtifacts '**/systemtest_prereqs/tools/tools.jar' } else { - sh 'curl -Os https://raw.githubusercontent.com/adoptium/TKG/master/scripts/getDependencies.pl' - sh 'perl ./getDependencies.pl -path . -task default' - archiveArtifacts '*.jar, *.zip, *.txt, *.gz' + def TKG_OWNER_BRANCH = params.TKG_OWNER_BRANCH ?: "adoptium:master" + def tokens = TKG_OWNER_BRANCH.split(':'); + if (tokens.size() == 2) { + def owner = tokens[0]; + def branch = tokens[1]; + sh "curl -Os https://raw.githubusercontent.com/${owner}/TKG/${branch}/scripts/getDependencies.pl" + sh 'perl ./getDependencies.pl -path . -task default' + archiveArtifacts '*.jar, *.zip, *.txt, *.gz' + } else { + assert false : "TKG_OWNER_BRANCH ${TKG_OWNER_BRANCH} is not expected format. (i.e., TKG_OWNER_BRANCH=adoptium:master)" + } + + } } finally { cleanWs()