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

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

commit 66039110e91fec838c76abc7e6cc60ce3f13c540
Author: Sebastian Rühl <sru...@apache.org>
AuthorDate: Thu Feb 22 12:45:45 2018 +0100

    split build into two cases where we are on master and not
---
 Jenkinsfile | 34 ++++++++++++++++++++++++----------
 1 file changed, 24 insertions(+), 10 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 8ee2794..5dcd91c 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -54,20 +54,31 @@ pipeline {
         }
 
         stage('Build') {
+            when {
+                expression {
+                    env.BRANCH_NAME != 'master'
+                }
+            }
             steps {
                 echo 'Building'
-                script {
-                    // Make sure the feature branches don't change the 
SNAPSHOTS in Nexus.
-                    def mavenGoal = "install"
-                    def mavenLocalRepo = ""
-                    if (env.BRANCH_NAME == 'master') {
-                        mavenGoal = "deploy sonar:sonar"
-                    } else {
-                        mavenLocalRepo = "-Dmaven.repo.local=.repository"
-                    }
-                    sh "${MVN_HOME}/bin/mvn -Pjenkins-build ${mavenLocalRepo} 
clean ${mavenGoal} site:site"
+                sh "${MVN_HOME}/bin/mvn -Pjenkins-build 
-Dmaven.repo.local=.repository clean install"
+            }
+            post {
+                always {
+                    junit(testResults: '**/surefire-reports/*.xml', 
allowEmptyResults: true)
+                    junit(testResults: '**/failsafe-reports/*.xml', 
allowEmptyResults: true)
                 }
             }
+        }
+
+        stage('Build') {
+            when {
+                branch 'master'
+            }
+            steps {
+                echo 'Building'
+                sh "${MVN_HOME}/bin/mvn -Pjenkins-build clean deploy 
sonar:sonar site:site"
+            }
             post {
                 always {
                     junit(testResults: '**/surefire-reports/*.xml', 
allowEmptyResults: true)
@@ -77,6 +88,9 @@ pipeline {
         }
 
         stage('Stage Site') {
+            when {
+                branch 'master'
+            }
             steps {
                 echo 'Staging Site'
                 sh "${MVN_HOME}/bin/mvn -Pjenkins-build ${mavenLocalRepo} 
site:stage"

-- 
To stop receiving notification emails like this one, please contact
sru...@apache.org.

Reply via email to