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

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


The following commit(s) were added to refs/heads/master by this push:
     new 9dfa4cd  [JENKINS-34376] Workaround Jenkins issue to detect aborted 
builds better
9dfa4cd is described below

commit 9dfa4cd551626ea6de1d9fac44872d063e34e040
Author: Stephen Connolly <stephen.alan.conno...@gmail.com>
AuthorDate: Wed Nov 29 11:18:40 2017 +0000

    [JENKINS-34376] Workaround Jenkins issue to detect aborted builds better
---
 vars/asfMavenTlpStdBuild.groovy | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/vars/asfMavenTlpStdBuild.groovy b/vars/asfMavenTlpStdBuild.groovy
index 024c08b..bafea47 100644
--- a/vars/asfMavenTlpStdBuild.groovy
+++ b/vars/asfMavenTlpStdBuild.groovy
@@ -48,6 +48,20 @@ def call(Map params = [:]) {
   properties([buildRetention])
   try {
     parallel(tasks)
+    currentBuild.result = "SUCCESS"
+    // JENKINS-34376 seems to make it hard to detect the aborted builds
+  } catch (org.jenkinsci.plugins.workflow.steps.FlowInterruptedException e) {
+    // this ambiguous condition means a user probably aborted
+    if (e.causes.size() == 0) {
+      currentBuild.result = "ABORTED"
+    } 
+    throw e
+  } catch (hudson.AbortException e) {
+    // this ambiguous condition means during a shell step, user probably 
aborted
+    if (e.getMessage().contains('script returned exit code 143')) {
+      currentBuild.result = "ABORTED"
+    }
+    throw e
   } finally {
     stage("Notifications") {
       jenkinsNotify()      

-- 
To stop receiving notification emails like this one, please contact
['"commits@maven.apache.org" <commits@maven.apache.org>'].

Reply via email to