Details
-
Type:
New Feature
-
Status: Closed (View Workflow)
-
Priority:
Minor
-
Resolution: Won't Do
-
Component/s: workflow-basic-steps-plugin
-
Labels:None
-
Similar Issues:
Description
On the issue https://issues.jenkins-ci.org/browse/JENKINS-45579 Devin Nusbaum has added a couple of really nice steps WarnErrorStep and CatchErrorStep, this improvement is a continuation of his work (mostly copy) to add another user case, when you need to ignore the failure of a stage but you want to mar the build as successful and it is not possible to use CatchErrorStep or you want to simplify your stage code, something like the following stage that it is waiting for an input on declarative where you can not use CatchErrorStep for the input, ignoreErrors option would mark the build as SUCCESS and the stage as UNSTABLE.
stage('Release Candidate') { agent any options { ignoreErrors('Release Candidate was not uploaded') } input { message 'Should we upload the Release Candidate version?' ok 'Yes, we should.' } when { beforeAgent true beforeInput true anyOf { tag "rc-\\d+\\.\\d+\\.\\d+*" } } steps { echo "My Release Candidate process" } }
Attachments
Issue Links
- links to
Ivan Fernandez Calvo Thanks for the RFE. I'm not quite sure what ignoreErrors is doing in your example, it looks like a block scope step because it is in options, but by your description it sounds like a basic step like unstable?
If I understand correctly, maybe better to just add option to the unstable step, so it could be used like this:
If you mean for ignoreErrors to act like catchError(buildResult: 'SUCCESS', stageResult: 'UNSTABLE'), I think you could just put that in options today, like this (untested):