Hey guys,
I have this problem. We have several projects, which have a script, which
starts the build process of the project. This script is called build.sh
(builds are made on Linux). Some of these build scripts need some
parameter.
As I do not want always write ./build.sh Paramter1 Parameter2, I wrote a
managed script, which does it for me, so I only have to add the parameters.
So the managed linux script start the build script.
The managed script looks like this
> # exit on error
> set -o errexit
> pushd $PROJECT_SRC
> chmod +x build.sh
> sudo ./build.sh $PARA1 $PARA2 $PARA3
The problem is this: When someone aborts a Job for whatever reason, the
state of the jobs is not aborted, but failure. This is somehow annoying.
So I tried some things to change that
1) Trying to catch SIGTERM signal in the managed script, so in the end, the
managed script looked like this:
> on_sigterm()
> {
> exit 0
> }
> trap 'on_sigterm' SIGTERM SIGHUP SIGINT
> # exit on error
> set -o errexit
> pushd $PROJECT_SRC
> chmod +x build.sh
> sudo ./build.sh $PARA1 $PARA2 $PARA3
2) Trying to catch SIGTERM signal in the build.sh script. That also did not
work.
3) Both, trying to catch SIGTERM in managed script and in build.sh script.
4) Trying to read the log of the job, with the help of Jenkins TextFinder
plugin. I searched in the log for something like this
'java.lang.InterruptedException', and as far as I could see, the plugin
found this text, but didn't change the state of the job to unstable or
success.
5) Do you have some other ideas which might help me to solve this problem?
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/CAO5HUhM9UWuwhnp2UJNs8nMX1CjfThPTFZbOrdJDM2HMezO5sg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.