aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Rendina <mrendina@stsci.edu>2017-08-29 13:04:05 -0400
committerMatt Rendina <mrendina@stsci.edu>2017-08-29 13:04:05 -0400
commit87e85f194b7906a48cafa865ff4196f92bdc916b (patch)
treeebbfc0298de72ede5809b2830d9c5712a49b262b
parent27ae0359769f81288d19acdef316e6a84925b60f (diff)
downloadbuild_control-87e85f194b7906a48cafa865ff4196f92bdc916b.tar.gz
Use entire tag ref spec string
-rw-r--r--jenkins/job-suite-generator.groovy8
1 files changed, 6 insertions, 2 deletions
diff --git a/jenkins/job-suite-generator.groovy b/jenkins/job-suite-generator.groovy
index c53ec2e..1015d02 100644
--- a/jenkins/job-suite-generator.groovy
+++ b/jenkins/job-suite-generator.groovy
@@ -37,14 +37,18 @@ node("master") {
// value to the jobDSL script.
// Both 'scm.getUserRemoteConfigs' and 'getUrl' require script approval
- build_control_repo= scm.getUserRemoteConfigs()[0].getUrl()
+ build_control_repo = scm.getUserRemoteConfigs()[0].getUrl()
sh "echo ${build_control_repo} > VAR-build_control_repo"
// Get branch spec component after last '/' character.
// Branch names themselves shall not have slashes in them
// when specified in the job-suite-generator job configuration.
// This may also describe a tag, rather than a branch.
- build_control_branch = scm.branches[0].toString().tokenize("/")[-1]
+ if (build_control_branch.find("tags") != null) {
+ build_control_branch = scm.branches[0].toString()
+ } else {
+ build_control_branch = scm.branches[0].toString().tokenize("/")[-1]
+ }
sh "echo ${build_control_branch} > VAR-build_control_branch"
// 'Parameters' variables are provided by the execution of the