Include build failure root cause in email notification (#2491)
Signed-off-by: shiranj <shiranj@amazon.com>
This commit is contained in:
Vendored
+12
-6
@@ -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) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user