aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Rendina <mrendina@stsci.edu>2017-06-30 14:45:35 -0400
committerMatt Rendina <mrendina@stsci.edu>2017-06-30 14:45:35 -0400
commitb3a06f88e93a1b37ffe7f70f8f9e3358142dca0a (patch)
tree75e19088aa6238a4030e5574a7d47221d1e608a2
parent1144d01490996fa1d02b0546bc9de5109499ab69 (diff)
downloadbuild_control-b3a06f88e93a1b37ffe7f70f8f9e3358142dca0a.tar.gz
Improved granularity and ratcheting of status values from build jobs
-rw-r--r--jenkins/dispatch.groovy4
-rw-r--r--jenkins/package_builder.groovy15
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}"
}
}
}