How To Execute a stage even if previous stage has failed?

11 views
Skip to first unread message

Omeka

unread,
Dec 23, 2016, 6:25:35 AM12/23/16
to Jenkins Users
In scripted pipeline the use of try/catch/finaly allows a stage to be executed even though the previous stage has failed, let say unit tests, checkstyles have failed and we still want to execute a sonaqube analysis (why would we want to do that is another question for another group).

In the declarative pipeline model however if the testing stages is executed and it turns out that some tests have failed the next stage is skipped. I was wondering if there is a way to that in declarative pipeline? 

The only thing i see is worth exploring is making sure the sh command that execute the tests steps doesn't return an exit code that is a non zero, which should allow the test to continue but i am wondering if jenkins will still report a failed build?

Omeka
Reply all
Reply to author
Forward
0 new messages