From 1a4f161ea4f28378c23172625cd14f561c2207f7 Mon Sep 17 00:00:00 2001 From: Dylan Simon Date: Thu, 22 Feb 2018 17:48:32 -0500 Subject: [PATCH] [jenkins] Add email alerts on failure --- Jenkinsfile | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6ea10bd9..fbfa59bc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -83,4 +83,31 @@ for (int i = 0; i < osxPlatforms.size(); i++) { } } } -parallel platforms +try { + parallel platforms +} catch (err) { + emailext( + subject: "\$PROJECT_NAME - Build # \$BUILD_NUMBER - FAILED", + body: """\$PROJECT_NAME - Build # \$BUILD_NUMBER - FAILED + +$err + +Check console output at \$BUILD_URL to view full results. + +Building \$BRANCH_NAME for \$CAUSE +\$JOB_DESCRIPTION + +Chages: +\$CHANGES + +End of build log: +\${BUILD_LOG,maxLines=60} + """, + to: 'mzingl@flatironinstitute.org, hstrand@flatironinstitute.org, nils.wentzell@gmail.com, dsimon@flatironinstitute.org', + recipientProviders: [ + [$class: 'DevelopersRecipientProvider'], + ], + replyTo: '$DEFAULT_REPLYTO' + ) + throw err +}