Hi,
Any idea how can I add support for InterruptedException to my plugin?
I have a builder plugin that zips some files from the workspace and then
uploads them on a remote server.
The flow is basically like this:
---
public void perform(@Nonnull Run<?, ?> build, @Nonnull FilePath workspace,
@Nonnull Launcher launcher, @Nonnull TaskListener
listener) throws IOException {
launcher.getChannel().call(deployCallable);
}
---
deployCallable is an instance of a inner class described bellow:
---
private static class DeployCallable extends MasterToSlaveCallable<Boolean,
InterruptedException> { // So it works in master/slave setup
private static final long serialVersionUID = 1L;
public Boolean call() throws InterruptedException {
for folder in path {
zip(folder);
}
for zip in zipFiles {
upload(zip); // Using Apache HTTP Client
}
}
}
---
The problem is that that if I click cancel on the job it still runs until
by build step is finished and all files are zipped and uploaded and only
then it marks the build as aborted.
Is there any way to check from my plugin if the job was aborted and just
stop wherever I am in the build?
Let's say I just created the zips and user clicks on cancel, how do I stop
here and not also upload all zips?
Thank you.
--
You received this message because you are subscribed to the Google Groups
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-dev/dd13bde5-830d-49c9-a18d-a41d555e2e7b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.