diff options
author | Holger Levsen <holger@layer-acht.org> | 2014-11-07 10:45:17 +0000 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2014-11-07 10:45:17 +0000 |
commit | 82a784eef9a69d34e3ed492e0cb8478759eddab4 (patch) | |
tree | 5988ae4e76070ed893d04479faf99750fde9707d | |
parent | 4ec97ef52ce5c71e102d7bc10268de1ea71ffdde (diff) | |
download | jenkins.debian.net-82a784eef9a69d34e3ed492e0cb8478759eddab4.tar.xz |
common-function: at the beginning of each job: provide link to git repo and explain which script is called how for each job
-rwxr-xr-x | bin/common-functions.sh | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/bin/common-functions.sh b/bin/common-functions.sh index cbc044f8..80908851 100755 --- a/bin/common-functions.sh +++ b/bin/common-functions.sh @@ -8,6 +8,13 @@ common_cleanup(){ rm -f $TTT } +# +# run ourself with the same parameter as we are running +# but run a copy from /tmp so that the source can be updated +# (Running shell scripts fail weirdly when overwritten when running, +# this hack makes it possible to overwrite long running scripts +# anytime...) +# common_init() { # check whether this script has been started from /tmp already if [ "${0:0:5}" != "/tmp/" ] ; then @@ -23,14 +30,20 @@ if [ "${0:0:5}" != "/tmp/" ] ; then # cp $0 to /tmp and run it from there cp $0 $TTT chmod +x $TTT - # run ourself with the same parameter as we are running - # but run a copy from /tmp so that the source can be updated - # (Running shell scripts fail weirdly when overwritten when running, - # this hack makes it possible to overwrite long running scripts - # anytime...) - # (setsid is not related to this hack. see commit log for 24deda5a8 it.) - echo "$(date) - start running \"$0\" as \"$TTT\" using \"$@\" as arguments." + echo "====================================================================================" + echo + echo "$(date) - running job $JOB_NAME now." + echo + echo "To understand what this job does, clone git.debian.org/git/qa/jenkins.debian.net.git" + echo "and then have a look at bin/$(basename $0)" + echo + echo "The script is called using \"$@\" as arguments." echo + echo "====================================================================================" + echo + echo "$(date) - start running \"$0\" as \"$TTT\"." + # this is the "hack": call ourself as a copy in /tmp again + # (setsid is not related to this hack. see commit log for 24deda5a8 it.) /srv/jenkins/bin/setsid.py $TTT "$@" exit $? # cleanup is done automatically via trap |