Is there a way to enable/disable build steps of a build job in Jenkins. A method like a check box to enable/disable the build steps, so we can temporarily skip some steps which should not run. (This is helpful for testing a build job)
I would like to know whether there is a plugin to do this?
Pipeline jobs can be stopped by sending an HTTP POST request to URL endpoints of a build. BUILD ID URL/stop - aborts a Pipeline. BUILD ID URL/term - forcibly terminates a build (should only be used if stop does not work). BUILD ID URL/kill - hard kill a pipeline.
Set the "Restrict where this job can be run" check box in your job configuration and specify the name of your slave. If you add more slaves later, you can set labels for each slave and specify those in your job configs. See this reference documentation: https://wiki.jenkins-ci.org/display/JENKINS/Distributed+builds.
You can use the Conditional Build Step Plugin to do this. Surround the build step you want to toggle in a conditional step (single) and set it to run 'Never'. This will skip the build step until you want to enable it again.
If you want it to be a dynamic option you can script the plugin to enable or disable the build step depending on whether particular conditions are met, eg: A parameter has a particular value, a file exists, etc.
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