Detecting build abort in declarative pipeline

179 views
Skip to first unread message

Dan Tran

unread,
May 21, 2017, 4:29:33 PM5/21/17
to Jenkins Users

Hi is there a way to figure if the build is aborted also able to distinguish if is timed out or aborted by user

Thanks

-Dan

James Dumay

unread,
May 22, 2017, 4:12:50 PM5/22/17
to Jenkins Users
Out of curiosity if we did add a way to detect aborts what would you do with it?

Dan Tran

unread,
May 22, 2017, 4:45:54 PM5/22/17
to Jenkins Users

our build sends out email notification for every build ( dont ask why: -), in case of intentional abort build by admin we prefer not to email out to reduce the noise. But still send to slack

Thanks

-Dan

James Dumay

unread,
May 22, 2017, 5:27:16 PM5/22/17
to jenkins...@googlegroups.com
If we introduced something like the following for both the pipeline and stage level, would that cover your use case?

pipeline {
  post {
    aborted {
      echo 'fired on abort'
    }
  }
}

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/p98pCionpdk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/15e52884-841b-40ef-a9c8-cc7527e28d70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
James Dumay,
Director of Product Management.
CloudBees, Inc.
Skype: jdumaycb Twitter: i386

Dan Tran

unread,
May 22, 2017, 10:29:41 PM5/22/17
to Jenkins Users

not quite, we still need to distinguish  abort with timeout

Thanks 

-Dan

James Dumay

unread,
May 28, 2017, 10:38:11 PM5/28/17
to Jenkins Users
Would you mind raising a ticket for this on http://issues.jenkins-ci.org/ under the "pipeline-model-definition" component? We can take the discussion further there.


For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages