This is an automated email from the ASF dual-hosted git repository.

stephenc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-jenkins-env.git


The following commit(s) were added to refs/heads/master by this push:
     new 1da40a4  Let's see if this works
1da40a4 is described below

commit 1da40a476141139e51f1ed8a40cc1e36db090111
Author: Stephen Connolly <stephen.alan.conno...@gmail.com>
AuthorDate: Tue Nov 28 19:25:36 2017 +0000

    Let's see if this works
---
 vars/jenkinsNotify.groovy | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/vars/jenkinsNotify.groovy b/vars/jenkinsNotify.groovy
index 633faeb..ffa6285 100644
--- a/vars/jenkinsNotify.groovy
+++ b/vars/jenkinsNotify.groovy
@@ -1,3 +1,40 @@
 #!/usr/bin/env groovy
 def call(Map params = [:]) {
+    def providers
+    def messageBody
+    def messageSubject
+    switch(currentBuild.currentResult) {
+        case "SUCCESS":
+            providers = []
+            messageSubject = "Build succeeded in Jenkins: 
${currentBuild.fullDisplayName}"
+            messageBody = """See ${currentBuild.absoluteUrl}"""
+        break
+        case "UNSTABLE":
+            providers = [[$class: 'CulpritsRecipientProvider']]
+            messageSubject = "Build unstable in Jenkins: 
${currentBuild.fullDisplayName}"
+            messageBody = """See ${currentBuild.absoluteUrl}"""
+        break
+        case "FAILURE":
+            providers = [[$class: 'CulpritsRecipientProvider']]
+            messageSubject = "Build failed in Jenkins: 
${currentBuild.fullDisplayName}"
+            messageBody = """See ${currentBuild.absoluteUrl}"""
+        break
+        case "ABORTED":
+            providers = [[$class: 'CulpritsRecipientProvider']]
+            messageSubject = "Build aborted in Jenkins: 
${currentBuild.fullDisplayName}"
+            messageBody = """See ${currentBuild.absoluteUrl}"""
+        break
+        default:
+        // should never happen if we are actually being invoked.
+        return
+    }
+    if (changeSets.empty) {
+        messageBody = messageBody+"\n\nNo changes.\n";
+    } else {
+        messageBody = messageBody + "\n\nChanges:\n";
+        for (def change in currentBuild.changeSets) {
+            messageBody = messageBody + "\n* ${change.msg}"
+        }
+    }
+    emailext body: messageBody, recipientProviders: providers, replyTo: 
'd...@maven.apache.org', subject: messageSubject, to: 
'notificati...@maven.apache.org'
 }
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
['"commits@maven.apache.org" <commits@maven.apache.org>'].

Reply via email to