Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a Jenkins job status as aborted

Tags:

jenkins

hudson

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?

like image 251
user1095640 Avatar asked Dec 13 '11 11:12

user1095640


People also ask

How do I abort all builds 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.

How do I find out who aborted Jenkins?

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.


1 Answers

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".

like image 169
Gábor Lipták Avatar answered Sep 28 '22 04:09

Gábor Lipták