INFRA-1743 E-mail & Slack notifications

This commit is contained in:
Connel McGovern 2022-05-09 13:22:40 +01:00 committed by GitHub
parent c624bb0cc0
commit 7ac3889172
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -408,19 +408,21 @@ pipeline {
}
}
}
success {
script {
sendSlackNotifications("good", "BUILD PASSED", false, "#corda-corda4-open-source-build-notifications")
}
}
unstable {
script {
sendSlackNotifications("warning", "BUILD UNSTABLE - Unstable Builds are likely a result of Nexus Sonar Scanner violations", false, "#corda-corda4-open-source-build-notifications")
}
}
failure {
script {
def statusSymbol = '\u274c'
sendSlackNotifications("danger", "BUILD FAILURE", true, "#corda-corda4-open-source-build-notifications")
if (isReleaseTag || isReleaseBranch || isReleaseCandidate) {
emailext subject: "$statusSymbol " + '$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!',
body: '${SCRIPT, template="groovy-html.template"}',
recipientProviders: [
[$class: 'CulpritsRecipientProvider'],
[$class: 'RequesterRecipientProvider']
],
mimeType: 'text/html',
replyTo: '$DEFAULT_REPLYTO',
to: "adel.el-beik@r3.com"
sendEmailNotifications("${env.EMAIL_RECIPIENTS}")
}
}
}