Compare commits

...

1 Commits

Author SHA1 Message Date
Emmanuel Cazenave 79b74f6379 don't send mail when the build is aborted (#26040) 2019-03-06 17:51:30 +01:00
1 changed files with 13 additions and 11 deletions

View File

@ -9,17 +9,19 @@ def mail_notify(currentBuild, env, email) {
// Hack to have the 'jenkins build back to normal' mail sent
currentBuild.result = 'SUCCESS'
}
if (env.GIT_BRANCH == 'origin/master') {
step([
$class: 'Mailer', notifyEveryUnstableBuild: true,
recipients: email, sendToIndividuals: true
])
} else {
author = sh(returnStdout: true, script: "/usr/bin/git show -s --format='%ae' HEAD").trim()
step([
$class: 'Mailer', notifyEveryUnstableBuild: true,
recipients: author, sendToIndividuals: true
])
if (currentBuild.result != 'ABORTED') {
if (env.GIT_BRANCH == 'origin/master') {
step([
$class: 'Mailer', notifyEveryUnstableBuild: true,
recipients: email, sendToIndividuals: true
])
} else {
author = sh(returnStdout: true, script: "/usr/bin/git show -s --format='%ae' HEAD").trim()
step([
$class: 'Mailer', notifyEveryUnstableBuild: true,
recipients: author, sendToIndividuals: true
])
}
}
}