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

cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git


The following commit(s) were added to refs/heads/develop by this push:
     new bf5f708  Make the email code only send emails for develop.
bf5f708 is described below

commit bf5f708fc145d00200d7eed555c261e4e7252881
Author: Christofer Dutz <christofer.d...@c-ware.de>
AuthorDate: Tue Dec 11 10:40:41 2018 +0100

    Make the email code only send emails for develop.
---
 Jenkinsfile | 34 +++++++++++++++++++++-------------
 1 file changed, 21 insertions(+), 13 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 02a3f76..5bda983 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -200,36 +200,44 @@ pipeline {
     post {
         // If this build failed, send an email to the list.
         failure {
-            emailext(
-                subject: "[BUILD-FAILURE]: Job '${env.JOB_NAME} 
[${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
-                body: """
+            script {
+                if(env.BRANCH_NAME == "develop") {
+                    emailext(
+                        subject: "[BUILD-FAILURE]: Job '${env.JOB_NAME} 
[${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
+                        body: """
 BUILD-FAILURE: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] 
[${env.BUILD_NUMBER}]':
 
 Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME} 
[${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]</a>"
 """,
-                to: "d...@plc4x.apache.org",
-                recipientProviders: [[$class: 'DevelopersRecipientProvider']]
-            )
+                        to: "d...@plc4x.apache.org",
+                        recipientProviders: [[$class: 
'DevelopersRecipientProvider']]
+                    )
+                }
+            }
         }
 
         // If this build didn't fail, but there were failling tests, send an 
email to the list.
         unstable {
-            emailext(
-                subject: "[BUILD-UNSTABLE]: Job '${env.JOB_NAME} 
[${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
-                body: """
+            script {
+                if(env.BRANCH_NAME == "develop") {
+                    emailext(
+                        subject: "[BUILD-UNSTABLE]: Job '${env.JOB_NAME} 
[${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
+                        body: """
 BUILD-UNSTABLE: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] 
[${env.BUILD_NUMBER}]':
 
 Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME} 
[${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]</a>"
 """,
-                to: "d...@plc4x.apache.org",
-                recipientProviders: [[$class: 'DevelopersRecipientProvider']]
-            )
+                        to: "d...@plc4x.apache.org",
+                        recipientProviders: [[$class: 
'DevelopersRecipientProvider']]
+                    )
+                }
+            }
         }
 
         // Send an email, if the last build was not SUCCESSfull and this one 
is.
         success {
             script {
-                if (currentBuild.previousBuild != null && 
currentBuild.previousBuild.result != 'SUCCESS') {
+                if ((env.BRANCH_NAME == "develop") && 
(currentBuild.previousBuild != null) && (currentBuild.previousBuild.result != 
'SUCCESS')) {
                     emailext (
                         subject: "[BUILD-STABLE]: Job '${env.JOB_NAME} 
[${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
                         body: """

Reply via email to