Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gracefully stopping a build step (plugin) on build abort

I have a plugin in Jenkins that operates a remote server via rest.
How can I send one last request to the server on build abort? Thus, gracefully finishing the work of the plugin?

The only reference to the 'Abort sequence' that I found is this. Which makes me think that the procedure is very rough, and that I can't catch the signal before it terminates the child (my plugin).

like image 944
bldoron Avatar asked Jan 02 '13 09:01

bldoron


People also ask

Why is my Jenkins build taking so long?

Fortunately, the most common reasons your Jenkins instance is slow are easy to diagnose and correct: Non-performant plugins. Poorly tuned JVM arguments. Non-optimal garbage collection.


1 Answers

I have a similar need, which I solved with the PostBuildScript Plugin.

I choose to run a build step, but you can run several other options. Very easy to use. I have a script I must run regardless of how the build ended (success, fail or abort). It works great for me.

I hope this helps.

like image 137
Eldad Assis Avatar answered Sep 26 '22 22:09

Eldad Assis