Is it possible to detect Jenkins build abort event in Builder plugin and perform graceful process finalization?
This is the only information I was able to find: https://wiki.jenkins-ci.org/display/JENKINS/Aborting+a+build
Is it possible to detect Jenkins build abort event in Builder plugin and perform graceful process finalization?
This is the only information I was able to find: https://wiki.jenkins-ci.org/display/JENKINS/Aborting+a+build
InterruptedException is thrown on job abort, so by catching it, it is possible to detect and handle job termination.
More detailed information can be found here.
You can use Post-build task plugin:-
https://wiki.jenkins-ci.org/display/JENKINS/Post+build+task
Use this plugin to grep when is the build aborted. Add the search message and then run your clean-up script (shell script also works here.)
For more info about aborting build in Jenkins ,click here
Also this might be useful