After reading a bit in the Jenkins sources I found a work around which works
for me:
throw new InterruptedException()
marks the build as ABORTED and does not process any further build actions.
Anyway I filled a bug report for the non-working Executor.interrupt() method:
https://issues.jenkins-
I am running 1.488 and can abort builds via UI.
But invoking the following function in a groovy script:
build.getExecutor().interrupt(Result.ABORTED)
does not cancel the build but run in to the end (including all following build
actions) and marks the build as FAILED.
- Dirk
On 08.11.2012 0
"Since the user can trigger that kind of command via the UI there should be
some corresponding API for that, right?"
Stopping via UI executes the same [build.getExecutor().interrupt()], so you
may have same problems with aborting builds from UI.
Also, want notice that after upgrading from 1.477
As mentioned in my original post both of the following will mark the build as
failed (not aborted) and will also process all further build actions:
build.getExecutor().interrupt()
build.getExecutor().interrupt(Result.ABORTED)
Especially that the second line marks the build as failed I would
build.getExecutor().interrupt();
On Monday, November 5, 2012 8:51:07 AM UTC+2, dthomas wrote:
>
> bump :-)
>
> Since the user can trigger that kind of command via the UI there should be
> some corresponding API for that, right?
> I only found methods with Stapler request and response objects as
bump :-)
Since the user can trigger that kind of command via the UI there should be
some corresponding API for that, right?
I only found methods with Stapler request and response objects as
parameters - but I should rather not pass fake arguments I guess.
Can somebody confirm that no correspond
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 bu