I am trying to execute a shell script if either the build pass or fails after post-build in Jenkins. I cannot see this option in post build to execute some shell script except for running a target.
I think you are looking for PostBuild Script Plugin. After install this plugin, you can add post-action "Execute Shell" by following these steps: Add post-build action -->Execute a set of scripts --> Add build Step --> Execute Shell.
When you configure your jenkins job there is a section where you can specify post build actions. If this plugin is not visible then you need to download it. After that you can specify the script or the contents of the script. Click on apply and run the job.
Very easily done with Post build task plugin.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With