on-internet
← Community

How to run a conditional step in Jenkins only when a previous step fails

Stack Overflow ·

I'm trying to create a 2 step job in Jenkins. I want the second step only to run if the first step fails. (The first step executes a unit test to see if the code I'm compiling is good - if it is not then i want to run some diagnostics in the second step). The conditional step plug seems a good choice for this. However, I can't work out how to use the conditional step plug in to cause the second step to run when the first step fails. The conditional step plug in offers a list of conditions such as 'Never', 'Boolean condition' ... and 'Current Build Status'. I would have thought I should use a '

Comments

Sign in or sign up to comment and upvote.

No comments yet.