summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Cazenave <ecazenave@entrouvert.com>2019-03-06 16:51:30 (GMT)
committerEmmanuel Cazenave <ecazenave@entrouvert.com>2019-03-06 16:51:30 (GMT)
commit79b74f6379118bdedae3b226216b14238a3ffdf5 (patch)
treee3e459d60e6fcb344c94663a6d55ed225750f729
parent9c73d72476dffedf68c779ab41b3bff403901d57 (diff)
downloadjenkins-lib-79b74f6379118bdedae3b226216b14238a3ffdf5.zip
jenkins-lib-79b74f6379118bdedae3b226216b14238a3ffdf5.tar.gz
jenkins-lib-79b74f6379118bdedae3b226216b14238a3ffdf5.tar.bz2
don't send mail when the build is aborted (#26040)wip/dev
-rw-r--r--src/eo/Utils.groovy24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/eo/Utils.groovy b/src/eo/Utils.groovy
index e647b51..4cb2ba8 100644
--- a/src/eo/Utils.groovy
+++ b/src/eo/Utils.groovy
@@ -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
+ ])
+ }
}
}