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:42:40 UTC

[incubator-zipkin-brave-karaf] branch master updated: Jenkinsfile tweaks (#15)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 21495d3  Jenkinsfile tweaks (#15)
21495d3 is described below

commit 21495d30941bb9628cef60fd2f03f048f29e81b1
Author: Zoltán Nagy <ab...@gmail.com>
AuthorDate: Thu Jan 31 10:42:36 2019 +0000

    Jenkinsfile tweaks (#15)
    
    * 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
    * Add License header to Jenkinsfile
    * Remove unneeded poll trigger
---
 Jenkinsfile | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 50 insertions(+), 8 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index f521de9..e21450b 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,19 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 pipeline {
     agent {
         label 'ubuntu'
     }
-    
+
     tools {
         jdk 'JDK 1.8 (latest)'
     }
 
     options {
-        buildDiscarder(logRotator(numToKeepStr: '10'))
+        buildDiscarder(logRotator(
+            numToKeepStr: '30',
+        ))
         timestamps()
-    }
-
-    triggers {
-        pollSCM('H/15 * * * *')
+        skipStagesAfterUnstable()
+        timeout time: 30, unit: 'MINUTES'
     }
 
     stages {
@@ -23,7 +40,7 @@ pipeline {
                 checkout scm
             }
         }
-        
+
         stage('Check environment') {
             steps {
                 sh 'env'
@@ -39,13 +56,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}>"
+                    )
+                }
+            }
+
+        }
     }
 }