You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zipkin.apache.org by ab...@apache.org on 2019/01/31 10:27:22 UTC

[incubator-zipkin-brave-karaf] 43/43: [jenkins] Tweaks, e-mail notification

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

abesto pushed a commit to branch jenkinsfile-tweaks
in repository https://gitbox.apache.org/repos/asf/incubator-zipkin-brave-karaf.git

commit 82ca1bca965db7b584874a9689386240e66a6609
Author: Zoltan Nagy <ab...@fb.com>
AuthorDate: Thu Jan 31 10:23:14 2019 +0000

    [jenkins] Tweaks, e-mail notification
    
    * Keep 30 builds instead of 10
    * Don't run any stages after tests if tests fail
    * Time out after 30 minutes
    * WIP code for releasing snapshots from master
    * Mail notifications on master build status change
---
 Jenkinsfile | 33 +++++++++++++++++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 90fa378..1886524 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -8,8 +8,12 @@ pipeline {
     }
 
     options {
-        buildDiscarder(logRotator(numToKeepStr: '10'))
+        buildDiscarder(logRotator(
+            numToKeepStr: '30',
+        ))
         timestamps()
+        skipStagesAfterUnstable()
+        timeout time: 30, unit: 'MINUTES'
     }
 
     stages {
@@ -35,13 +39,38 @@ pipeline {
                 sh './mvnw clean install'
             }
         }
-    }
 
+        /*
+        TODO uncomment and finish up the command here once we're ready to release snapshots
+        stage('Publish snapshot') {
+            when {
+                branch 'master'
+            }
+            steps {
+                sh './mvnw $TODO'
+            }
+        }
+         */
+    }
 
     post {
         always {
             junit '**/target/surefire-reports/*.xml'
             deleteDir()
         }
+
+        changed {
+            script {
+                if (env.BRANCH_NAME == 'master') {
+                    emailext(
+                        subject: "[${currentBuild.projectName}] master is ${currentBuild.currentResult} (#${currentBuild.number})",
+                        to: 'notifications@zipkin.apache.org'
+                        replyTo: 'dev@zipkin.apache.org',
+                        body: "See <${currentBuild.absoluteUrl}>",
+                    )
+                }
+            }
+
+        }
     }
 }