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

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

commit b972a070276a25fa38fd8de3f3aa1a65e0673ed8
Author: Slawomir Jaranowski <[email protected]>
AuthorDate: Fri Dec 31 16:57:54 2021 +0100

    Deploy artifacts only for master branch
---
 Jenkinsfile | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 2ef2b4a..873fd86 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -36,7 +36,7 @@ final def jdks = [18, 17, 8]
 
 final def options = ['-e', '-V', '-B', '-nsu', '-P', 'run-its']
 final def goals = ['clean', 'install']
-final def goalsDepl = ['clean', 'deploy', 'jacoco:report']
+final def goalsDepl = ['clean', 'deploy']
 final Map stages = [:]
 
 oses.eachWithIndex { osMapping, indexOfOs ->
@@ -69,7 +69,9 @@ oses.eachWithIndex { osMapping, indexOfOs ->
                             allOptions += '--no-transfer-progress'
                         }
                         ws(dir: "${os == 'windows' ? "${TEMP}\\${BUILD_TAG}" : 
pwd()}") {
-                            buildProcess(stageKey, jdkName, mvnName, first ? 
goalsDepl : goals, allOptions, mavenOpts, first)
+                            buildProcess(stageKey, jdkName, mvnName,
+                                first  && env.BRANCH_NAME == 'master' ? 
goalsDepl : goals,
+                                allOptions, mavenOpts, first)
                         }
                     }
                 }
@@ -164,6 +166,11 @@ def buildProcess(String stageKey, String jdkName, String 
mvnName, goals, options
                 unstable(" executing command status= " + errorStatus)
             }
         }
+
+    } catch (Throwable e) {
+        println "Throwable: ${e}"
+        currentBuild.result = 'FAILURE'
+        throw e
     } finally {
         try {
             if (makeReports) {

Reply via email to