Include build failure root cause in email notification (#2491)

Signed-off-by: shiranj <shiranj@amazon.com>
main
Shirang Jia 4 years ago committed by GitHub
parent 902bdeb6d6
commit 4b817a6483
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -577,13 +577,19 @@ finally {
) )
} }
node('controller') { node('controller') {
step([ if("${currentBuild.currentResult}" == "SUCCESS") {
$class: 'Mailer', emailBody = "${BUILD_URL}\nSuccess!"
notifyEveryUnstableBuild: true, } else {
recipients: emailextrecipients([ buildFailure = tm('${BUILD_FAILURE_ANALYZER}')
emailBody = "${BUILD_URL}\n${buildFailure}!"
}
emailext (
body: "${emailBody}",
subject: "${currentBuild.currentResult}: ${JOB_NAME} - Build # ${BUILD_NUMBER}",
recipientProviders: [
[$class: 'RequesterRecipientProvider'] [$class: 'RequesterRecipientProvider']
]) ]
]) )
} }
} catch(Exception e) { } catch(Exception e) {
} }

Loading…
Cancel
Save