I have a groovy script that goes and promotes code. Long story short, I know at a point of time within that script if it was successful or not. I would like to fail the build if not successful. Is there a way in groovy to fail the build?
Example:
in the "execute Groovy script" plugin. you can write code.
(insert API call to promote code)
if(checkPromote()){
//fail build here
}
where 'checkPromote' returns a true or false value depending on the status of the promote.