I see that returning a non-zero integer in shell script executing on Jenkins will make the result marked as a failure.
How do I make it change to Aborted? Is there a plugin to do this? Can I avoid having to use GroovyScript?
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.
Abort the job by clicking the red X next to the build progress bar. Click on "Pause/resume" on the build to pause. Click on "Pause/resume" again to resume the build.
Instead of returning a non-zero integer and having the build fail, you could trigger an Abort on the build using its Rest API within the shell build step.
Example using curl:
curl -XPOST $BUILD_URL/stop
Example using wget:
wget --post-data="" $BUILD_URL/stop
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