In my declarative pipeline I need to repeat the same step in the unstable, failure, and aborted post conditions, e.g.
This is really crappy having to repeat the exact same tidy-up in three places.
What I'd really like is something like:
Where the unsuccessful steps would run at the end. The sequence of execution would thus be:
- always (first because it might affect the build result)
- success (the result cannot get better, so none of the following blocks can turn the result to a success)
- unstable (because we might have some steps that escalate the unstable to a failure, or get aborted because they take too long)
- failure (once the result is failure, it cannot get better)
- aborted (the failure block could be aborted)
- unsuccessful (a catch-all for any of the previous error modes)
With perhaps a finally condition at the end that always runs