diff options
| author | Matt Rendina <mrendina@stsci.edu> | 2017-11-30 15:32:32 -0500 |
|---|---|---|
| committer | Matt Rendina <mrendina@stsci.edu> | 2017-11-30 15:32:32 -0500 |
| commit | 61ee60d186f2fadd83ef4b7592f38fdaf01fa5b3 (patch) | |
| tree | d18eaaff5eacbe514bcda1d08ab9f9eccf4f89b0 /vars | |
| parent | 27739870778098123f77c323fe1d2c007690cbc2 (diff) | |
| download | jscu_refactor-61ee60d186f2fadd83ef4b7592f38fdaf01fa5b3.tar.gz | |
Cleanup and test map
Diffstat (limited to 'vars')
| -rw-r--r-- | vars/utils.groovy | 64 |
1 files changed, 31 insertions, 33 deletions
diff --git a/vars/utils.groovy b/vars/utils.groovy index 84c5aec..efb2ffb 100644 --- a/vars/utils.groovy +++ b/vars/utils.groovy @@ -1,4 +1,4 @@ -// Jenkinsfile utilities +// Jenkinsfile support utilities import BuildConfig.BuildConfig import org.apache.commons.lang3.SerializationUtils @@ -41,7 +41,6 @@ def concurrent(configs) { // Code defined within 'tasks' is eventually executed on a separate node. tasks["${config.nodetype}/${config.build_mode}"] = { node(config.nodetype) { - println("**** WORKSPACE = ${env.WORKSPACE}") // FIXME: Generalize env vars. for (var in myconfig.env_vars) { if (var.contains("PATH")) { @@ -50,41 +49,38 @@ def concurrent(configs) { env.PATH = "${tvar}:${env.PATH}" } } - //withEnv(myconfig.env_vars) { - //withEnv(vars) { - println("task: env.PATH = ${env.PATH}") - println("task: myconfig.nodetype = ${myconfig.nodetype}") - println("task: myconfig.build_mode = ${myconfig.build_mode}") - println("task: myconfig.env_vars = ${myconfig.env_vars}") - println("task: myconfig.build_cmds = ${myconfig.build_cmds}") - println("task: myconfig.test_cmds = ${myconfig.test_cmds}") - println("task: myconfig.run_tests = ${myconfig.run_tests}") - stage("Build (${myconfig.build_mode})") { - unstash "source_tree" - for (cmd in myconfig.build_cmds) { - sh(script: cmd) - } + println("task: env.PATH = ${env.PATH}") + println("task: myconfig.nodetype = ${myconfig.nodetype}") + println("task: myconfig.build_mode = ${myconfig.build_mode}") + println("task: myconfig.env_vars = ${myconfig.env_vars}") + println("task: myconfig.build_cmds = ${myconfig.build_cmds}") + println("task: myconfig.test_cmds = ${myconfig.test_cmds}") + println("task: myconfig.run_tests = ${myconfig.run_tests}") + stage("Build (${myconfig.build_mode})") { + unstash "source_tree" + for (cmd in myconfig.build_cmds) { + sh(script: cmd) } - if (myconfig.test_cmds.size() > 0) { - try { - stage("Test (${myconfig.build_mode})") { - for (cmd in myconfig.test_cmds) { - sh(script: cmd) - } + } + if (myconfig.test_cmds.size() > 0) { + try { + stage("Test (${myconfig.build_mode})") { + for (cmd in myconfig.test_cmds) { + sh(script: cmd) } } - finally { - // TODO: Test for presence of report file. - step([$class: 'XUnitBuilder', - thresholds: [ - [$class: 'SkippedThreshold', unstableThreshold: "${myconfig.skippedUnstableThresh}"], - [$class: 'SkippedThreshold', failureThreshold: "${myconfig.skippedFailureThresh}"], - [$class: 'FailedThreshold', unstableThreshold: "${myconfig.failedUnstableThresh}"], - [$class: 'FailedThreshold', failureThreshold: "${myconfig.failedFailureThresh}"]], - tools: [[$class: 'JUnitType', pattern: '*.xml']]]) - } } - //} //end withEnv + finally { + // TODO: Test for presence of report file. + step([$class: 'XUnitBuilder', + thresholds: [ + [$class: 'SkippedThreshold', unstableThreshold: "${myconfig.skippedUnstableThresh}"], + [$class: 'SkippedThreshold', failureThreshold: "${myconfig.skippedFailureThresh}"], + [$class: 'FailedThreshold', unstableThreshold: "${myconfig.failedUnstableThresh}"], + [$class: 'FailedThreshold', failureThreshold: "${myconfig.failedFailureThresh}"]], + tools: [[$class: 'JUnitType', pattern: '*.xml']]]) + } + } } // end node } //end tasks @@ -94,6 +90,8 @@ def concurrent(configs) { } } //end concurrent + +// Convenience function that performs a deep copy on the supplied object. def copy(obj) { return SerializationUtils.clone(obj) } |
