I am running some batch commands as a prebuild step for a build. I want to make the status of the build as aborted based on some conditions.
Can anyone tell me what is the errorlevel for 'aborted' in Jenkins?
The builds in the pending queue can be easily cancelled from the Jenkins UI by manually clicking on the red "x" icon next to each build.
but there's no info who aborted the build either. A workaround could be to curl http://<jenkins>/job/<project name>/<build #> in a Post build task script and to grep for <p>Aborted by user username</p> . curl the console log is the only (good) method.
You have to install the "Conditional build step plugin" and the "Fail the build" plugins. Then you simply add a conditional step, and if the condition is true, you can call the fail build step with state "aborted".
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