Jenkinsfile: check test results in separate stage

Project: http://git-wip-us.apache.org/repos/asf/logging-log4net/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4net/commit/b7dd1457
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4net/tree/b7dd1457
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4net/diff/b7dd1457

Branch: refs/heads/feature/cd-pipeline
Commit: b7dd14571426c53f3b147b69369407606c089603
Parents: 48af3ef
Author: Dominik Psenner <dpsen...@apache.org>
Authored: Wed Jul 5 16:02:16 2017 +0200
Committer: Dominik Psenner <dpsen...@apache.org>
Committed: Wed Jul 5 16:14:41 2017 +0200

----------------------------------------------------------------------
 Jenkinsfile | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/b7dd1457/Jenkinsfile
----------------------------------------------------------------------
diff --git a/Jenkinsfile b/Jenkinsfile
index 4fa07f4..66630a0 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -214,6 +214,12 @@ pipeline {
                                sh 'mv package/target/site/ package/site/'
                                sh 'rmdir -p --ignore-fail-on-non-empty 
package/target'
 
+                               // archive package
+                               archive 'package/**/*.*'
+               }
+
+               // archive the tests (this also checks if tests failed; if 
that's the case this stage should fail)
+               stage('check test results') {
                                // record test results
                                step([
                                        $class        : 'XUnitBuilder',
@@ -224,15 +230,12 @@ pipeline {
                                                        failIfNotNew         : 
true,
                                                        pattern              : 
'package/tests/bin/**/*.xml',
                                                        skipNoTestFiles      : 
true,
-                                                       stopProcessingIfError: 
false
+                                                       stopProcessingIfError: 
true
                                                ]
                                        ]
                                ])
-
-                               // archive package
-                               archive 'package/**/*.*'
-                       }
                }
+
                stage('publish site') {
                        when {
                                branch 'master'

Reply via email to