diff options
author | Matt Rendina <rendinam@users.noreply.github.com> | 2018-06-12 16:43:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-12 16:43:19 -0400 |
commit | 63a8108afd06753d595a703273afb35d58543dd8 (patch) | |
tree | bde2a996339838943be6a99ec7b24dc0e30cb6c0 | |
parent | 9883adb887574f646881a04d436b840466def4d7 (diff) | |
parent | cd7b8b4d8d0c7ec1ad23ea47c01340c544eb9efc (diff) | |
download | jscu_refactor-63a8108afd06753d595a703273afb35d58543dd8.tar.gz |
Merge pull request #5 from spacetelescope/build_mode_to_name_21.1.1
Allow for transition to new BuildConfig property name:
-rw-r--r-- | vars/utils.groovy | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/vars/utils.groovy b/vars/utils.groovy index 536c5b6..888e467 100644 --- a/vars/utils.groovy +++ b/vars/utils.groovy @@ -41,14 +41,23 @@ def scm_checkout(skip_disable=false) { def run(configs, concurrent = true) { def tasks = [:] for (config in configs) { - - def myconfig = new BuildConfig() // MUST be inside for loop. + + def BuildConfig myconfig = new BuildConfig() // MUST be inside for loop. myconfig = SerializationUtils.clone(config) + + def config_name = "" + config_name = config.name + // For staged deprecation of '.build_mode' in favor of '.name'. + // TODO: Remove once all Jenkinsfiles are converted. + if (myconfig.build_mode != "") { + config_name = myconfig.build_mode + } + println("config_name: ${config_name}") // Code defined within 'tasks' is eventually executed on a separate node. // 'tasks' is a java.util.LinkedHashMap, which preserves insertion order. - tasks["${config.nodetype}/${config.build_mode}"] = { - node(config.nodetype) { + tasks["${myconfig.nodetype}/${config_name}"] = { + node(myconfig.nodetype) { def runtime = [] // If conda packages were specified, create an environment containing // them and then 'activate' it. @@ -121,7 +130,7 @@ def run(configs, concurrent = true) { runtime.add(var) } withEnv(runtime) { - stage("Build (${myconfig.build_mode})") { + stage("Build (${myconfig.name})") { unstash "source_tree" for (cmd in myconfig.build_cmds) { sh(script: cmd) @@ -129,7 +138,7 @@ def run(configs, concurrent = true) { } if (myconfig.test_cmds.size() > 0) { try { - stage("Test (${myconfig.build_mode})") { + stage("Test (${myconfig.name})") { for (cmd in myconfig.test_cmds) { sh(script: cmd) } |