From cf25c53644c7d88eca1d183c295863ec438937e4 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Wed, 16 Sep 2015 10:52:38 +0200 Subject: use exec to start abort.sh to invoke it from within the current job run --- bin/abort.sh | 1 + bin/find_dpkg_trigger_cycles.sh | 2 +- bin/jenkins_master_wrapper.sh | 2 +- bin/reproducible_build.sh | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/abort.sh b/bin/abort.sh index 81b554af..cb254864 100755 --- a/bin/abort.sh +++ b/bin/abort.sh @@ -1,3 +1,4 @@ +#!/bin/bash TMPFILE=$(mktemp) curl https://jenkins.debian.net/jnlpJars/jenkins-cli.jar -o $TMPFILE diff --git a/bin/find_dpkg_trigger_cycles.sh b/bin/find_dpkg_trigger_cycles.sh index 02ac7e45..6a2cd0d8 100755 --- a/bin/find_dpkg_trigger_cycles.sh +++ b/bin/find_dpkg_trigger_cycles.sh @@ -173,7 +173,7 @@ curl --retry 3 --retry-delay 10 --globoff "http://binarycontrol.debian.net/?q=&p tmpdir=`mktemp -d --tmpdir="$scratch"` # curl is allowed to fail with exit status 23 because we want to stop # downloading immediately after control.tar.gz has been extracted - ( curl --retry 3 --retry-delay 10 --location --silent "$url" || [ "$?" -eq 23 ] || ( echo "curl failed">&2 && /srv/jenkins/bin/abort.sh ) ) \ + ( curl --retry 3 --retry-delay 10 --location --silent "$url" || [ "$?" -eq 23 ] || ( echo "curl failed">&2 && exec /srv/jenkins/bin/abort.sh ) ) \ | dpkg-deb --ctrl-tarfile /dev/stdin \ | tar -C "$tmpdir" --exclude=./md5sums -x if [ ! -f "$tmpdir/triggers" ]; then diff --git a/bin/jenkins_master_wrapper.sh b/bin/jenkins_master_wrapper.sh index f7eaaf4a..b8d08e4c 100755 --- a/bin/jenkins_master_wrapper.sh +++ b/bin/jenkins_master_wrapper.sh @@ -39,7 +39,7 @@ RESULT=$? if [ $RESULT -ne 0 ] ; then echo "$(date -u) - $NODE_NAME seems to be down, sleeping 15min before aborting this job." sleep 15m - /srv/jenkins/bin/abort.sh + exec /srv/jenkins/bin/abort.sh fi set -e # finally diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh index da3a9f4b..d6c4578e 100755 --- a/bin/reproducible_build.sh +++ b/bin/reproducible_build.sh @@ -273,7 +273,7 @@ handle_unhandled() { else sleep $2 fi - /srv/jenkins/bin/abort.sh + exec /srv/jenkins/bin/abort.sh exit 0 } @@ -541,7 +541,7 @@ remote_build() { if [ $RESULT -ne 0 ] ; then echo "$(date -u) - $NODE seems to be down, sleeping 23min before aborting this job." sleep 23m - /srv/jenkins/bin/abort.sh + exec /srv/jenkins/bin/abort.sh fi ssh -p $PORT $NODE /srv/jenkins/bin/reproducible_build.sh $BUILDNR ${SRCPACKAGE} ${SUITE} ${TMPDIR} RESULT=$? -- cgit v1.2.3-70-g09d2