Hello Everyone,

We started using Jenkins about a year ago and have been very happy with it. We 
keep finding more way to use it! Some of our jobs use hardware connected to the 
slave and when that slave job is canceled we need to execute a clean up step, 
how can this be done?

I'm looking for a solution for both Linux and Windows. On Linux I've tried 
using the trap command, but, I can't find any signal that trap can trap. On 
windows I haven't found any solution yet.

Here is the shell script that I have for Linux that works on the command line, 
but, not when I press the cancel button in Jenkins.

[code]
#!/bin/sh

trap "/home/jenkins/tmp/cleanup.sh" INT TERM
ant -f /home/jenkins/jenkins/ant.xml
[/code]

On the command line I'm testing with Ctrl+C (INT). Based on the webpage below I 
believe SIGTERM (TERM) should work for Jenkins' cancel button
https://wiki.jenkins-ci.org/display/JENKINS/Aborting+a+build

Can anyone offer me some advice on how to implement a clean up on cancel for 
Linux and Windows?

Thank you,
Eric

This message and any attachments may contain Cypress (or its subsidiaries) 
confidential information. If it has been received in error, please advise the 
sender and immediately delete this message.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to