I have a job which is pretty resource intensive.
That's why i want it to be executed only when all upstream jobs are stable.
Therefore I prepended a groovy script action to the job (original action now #2).
The groovy script checks that all upstream jobs are stable.
But I am unable to stop the build from groovy so that:
- the job is marked as "aborted" (not failed)
AND
- the following actions in that job are not executed
I am able to set the result of the build with:
build = Thread.currentThread().executable
build.setResult(Result.ABORTED)
But this would obviously continue the build and execute the following actions.
Both of the following will mark the build as failed and will also process all action:
build.getExecutor().interrupt()
build.getExecutor().interrupt(Result.ABORTED)
Any hint how to abort the job after the first action / groovy script without executing the following actions AND marking the job as ABORTED?
Thanks,
Dirk