diff options
author | Matt Rendina <mrendina@stsci.edu> | 2017-08-29 15:02:59 -0400 |
---|---|---|
committer | Matt Rendina <mrendina@stsci.edu> | 2017-08-29 15:02:59 -0400 |
commit | d20ca4b6f500c87cad65928dc2f7f57a9d57f4af (patch) | |
tree | 880166c3d308eb7bce9caf61a38981ca987e0d02 /jenkins | |
parent | 53bc06ae965b9908443027c70b47919a8e40f873 (diff) | |
download | build_control-d20ca4b6f500c87cad65928dc2f7f57a9d57f4af.tar.gz |
Better separation of branch and tag string sources
Diffstat (limited to 'jenkins')
-rw-r--r-- | jenkins/job-suite-generator.groovy | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/jenkins/job-suite-generator.groovy b/jenkins/job-suite-generator.groovy index 3be3428..1dc89c6 100644 --- a/jenkins/job-suite-generator.groovy +++ b/jenkins/job-suite-generator.groovy @@ -40,16 +40,17 @@ node("master") { build_control_repo = scm.getUserRemoteConfigs()[0].getUrl() build_control_tag = "" sh "echo ${build_control_repo} > VAR-build_control_repo" + build_control_bt_spec = scm.branches[0].toString() // 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. - if (build_control_branch.find("tags") != null) { + if (build_control_bt_spec.find("tags") != null) { build_control_branch = "master" - build_control_tag = build_control_branch.tokenize("/") + build_control_tag = build_control_bt_spec.tokenize("/")[-1] } else { // a branch, including */master - build_control_branch = scm.branches[0].toString().tokenize("/")[-1] + build_control_branch = build_control_bt_spec.tokenize("/")[-1] } sh "echo ${build_control_branch} > VAR-build_control_branch" sh "echo ${build_control_tag} > VAR-build_control_tag" |