aboutsummaryrefslogtreecommitdiff
path: root/jenkins/multi_trigger.groovy
diff options
context:
space:
mode:
authorMatt Rendina <rendinam@users.noreply.github.com>2018-04-17 12:47:55 -0400
committerGitHub <noreply@github.com>2018-04-17 12:47:55 -0400
commite82a34fa7896266a9c973306fdffe397c939c408 (patch)
tree39c665b2293916b7467cec41131b291044ba516c /jenkins/multi_trigger.groovy
parent3ca4348476ea9150e98468f462189c594903ae82 (diff)
downloadbuild_control-e82a34fa7896266a9c973306fdffe397c939c408.tar.gz
Catch and report error from an early failure of dispatch (#62)1.0.24
Test for a `null` build result description property.
Diffstat (limited to 'jenkins/multi_trigger.groovy')
-rw-r--r--jenkins/multi_trigger.groovy26
1 files changed, 17 insertions, 9 deletions
diff --git a/jenkins/multi_trigger.groovy b/jenkins/multi_trigger.groovy
index 1e9d9fd..c368c68 100644
--- a/jenkins/multi_trigger.groovy
+++ b/jenkins/multi_trigger.groovy
@@ -50,14 +50,23 @@ node('master') {
platcount = build_objs.size()
successes = 0
build_objs.each {
- key, value -> results_msg = "${results_msg}${key} build #: ${value.number}, result: ${value.result}\n"
- if (value.result == "SUCCESS") {
- successes++
- }
- for (pkg_result in value.description.split('\n')) {
- results_msg = "${results_msg}${pkg_result}\n"
- }
- results_msg = "${results_msg}\n"
+ key, value ->
+ if (value.result == "SUCCESS") {
+ successes++
+ }
+ // Check for early abort of _dispatch job before description exists.
+ if (value.description == null) {
+ result = "ERROR"
+ } else {
+ result = value.result
+ }
+ results_msg = "${results_msg}${key} build #: ${value.number}, result: ${result}\n"
+ if (value.description != null) {
+ for (pkg_result in value.description.split('\n')) {
+ results_msg = "${results_msg}${pkg_result}\n"
+ }
+ }
+ results_msg = "${results_msg}\n"
}
println(results_msg)
def recipients = mail_recipients.replaceAll("\n", " ").trim()
@@ -68,5 +77,4 @@ node('master') {
println("e-mail not sent: No recipients specified.")
}
}
-
}