diff options
author | Matt Rendina <rendinam@users.noreply.github.com> | 2017-06-30 14:46:04 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-30 14:46:04 -0400 |
commit | e0bf4d9b6b8e0b936f2ded3bf52ca2fa937a639f (patch) | |
tree | 75e19088aa6238a4030e5574a7d47221d1e608a2 | |
parent | 1144d01490996fa1d02b0546bc9de5109499ab69 (diff) | |
parent | b3a06f88e93a1b37ffe7f70f8f9e3358142dca0a (diff) | |
download | build_control-e0bf4d9b6b8e0b936f2ded3bf52ca2fa937a639f.tar.gz |
Merge pull request #18 from rendinam/stat_ratchet
Improved granularity and ratcheting of status values from build jobs
-rw-r--r-- | jenkins/dispatch.groovy | 4 | ||||
-rw-r--r-- | jenkins/package_builder.groovy | 15 |
2 files changed, 11 insertions, 8 deletions
diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy index f3168c6..edd873b 100644 --- a/jenkins/dispatch.groovy +++ b/jenkins/dispatch.groovy @@ -222,7 +222,9 @@ node(LABEL) { } // Set overall status to that propagated from individual jobs. // This will be the most severe status encountered in all sub jobs. - currentBuild.result = readFile this.build_status_file + def tmp_status = readFile this.build_status_file + tmp_status = tmp_status.trim() + currentBuild.result = tmp_status } } diff --git a/jenkins/package_builder.groovy b/jenkins/package_builder.groovy index 97c2c45..c05ac00 100644 --- a/jenkins/package_builder.groovy +++ b/jenkins/package_builder.groovy @@ -35,6 +35,7 @@ node(this.label) { "PYTHONUNBUFFERED: ${env.PYTHONUNBUFFERED}\n") def build_status = readFile this.build_status_file + build_status = build_status.trim() // In the directory common to all package build jobs, // run conda build --dirty for this package to use any existing work @@ -71,10 +72,10 @@ node(this.label) { returnStatus: true) if (stat != 0) { currentBuild.result = "FAILURE" - // Check if build status file already contains failure - // status. If not, write failure status to the file. + // Ratchet up the overall build status severity if this + // is the most severe seen so far. if (build_status != "FAILURE") { - sh "echo FAILURE > ${this.build_status_file}" + sh "echo ${currentBuild.result} > ${this.build_status_file}" } } } @@ -92,10 +93,10 @@ node(this.label) { returnStatus: true) if (stat != 0) { currentBuild.result = "UNSTABLE" - // Check if build status file already contains unstable - // status. If not, write unstable status to the file. - if (build_status != "FAILURE") { - sh "echo FAILURE > ${this.build_status_file}" + // Ratchet up the overall build status severity if this + // is the most severe seen so far. + if (build_status == "SUCCESS") { + sh "echo ${currentBuild.result} > ${this.build_status_file}" } } } |