running a shell script once build passes running a shell script once build passes jenkins jenkins

running a shell script once build passes


If you don't actually need to pass a parameter to the second build, make sure that "Trigger build without parameters" is checked in the parameterized build trigger options.


The "Post build task" allows you to query the console log of the build step, and is executed only when criteria is met.

Jenkins writes BUILD SUCCESSFUL in the console log for every build step that had passed.In your "Post build task" step, under Log text just put BUILD SUCCESSFUL, and under Script put your linux script/commands.

This way your script/commands will only be executed if the Build Step was successful