Run next job in sequence even if the previous job fails in a Jenkins Build flow
you can set propagate to false, that will ensure your workflow will continue if particular job fails:
build job: '<job_name>', propagate: false
For me, propagate: false
didn't worked, So I used ignore(FAILURE)
instead in my BuildFlow, to make sure that all the jobs in flow executes, even if there are failures. (Ref)
ignore(FAILURE) { build("JobToCall", Param1: "param1Val", Param2: "param2Val") }
You can use Jenkins Workflow Plugin as follows:
try { build 'A'} catch(e) { echo 'Build for job A failed'}try { build 'B'} catch(e) { echo 'Build for job B failed'}
You can extend this idiom to any number of jobs or any combination of success/failure flow you want (for example, adding build
steps inside catch
es if you want to build some job in case another failed).