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') {
step([
$class: 'Mailer',
notifyEveryUnstableBuild: true,
recipients: emailextrecipients([
if("${currentBuild.currentResult}" == "SUCCESS") {
emailBody = "${BUILD_URL}\nSuccess!"
} else {
buildFailure = tm('${BUILD_FAILURE_ANALYZER}')
emailBody = "${BUILD_URL}\n${buildFailure}!"
}
emailext (
body: "${emailBody}",
subject: "${currentBuild.currentResult}: ${JOB_NAME} - Build # ${BUILD_NUMBER}",
recipientProviders: [
[$class: 'RequesterRecipientProvider']
])
])
]
)
}
} catch(Exception e) {
}

Loading…
Cancel
Save