From f11b3cc452f10a7e69746d9c3837243545332ea9 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Sat, 10 Oct 2015 02:16:09 +0200 Subject: reproducible: refactor, turn remote error irc notifications into mails --- bin/reproducible_build.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'bin/reproducible_build.sh') diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh index e131d87f..b96c1d7a 100755 --- a/bin/reproducible_build.sh +++ b/bin/reproducible_build.sh @@ -275,12 +275,22 @@ handle_unhandled() { MESSAGE="$BUILD_URL met an unhandled $1, please check." echo "$MESSAGE" irc_message "$MESSAGE" + # no need to slow down + exec /srv/jenkins/bin/abort.sh + exit 0 +} + +handle_remote_error() { + unregister_build + MESSAGE="$BUILD_URL got remote $1" + echo "$(date -u ) - $MESSAGE" | tee -a /var/log/jenkins/reproducible-remote-error.log echo "Sleeping 5m before aborting the job." sleep 5m exec /srv/jenkins/bin/abort.sh exit 0 } + handle_enospace() { unregister_build MESSAGE="$BUILD_URL hit diskspace issues with $SRCPACKAGE on $SUITE/$ARCH, sleeping 30m." @@ -607,7 +617,7 @@ remote_build() { if [ $RESULT -eq 148 ] ; then handle_404 elif [ $RESULT -ne 0 ] ; then - handle_unhandled "exit code from remote build job" + handle_remote_error "with exit code $RESULT from $NODE for build #$BUILDNR for ${SRCPACKAGE} on ${SUITE}/${ARCH}" fi rsync -e "ssh -p $PORT" -r $NODE:$TMPDIR/b$BUILDNR $TMPDIR/ RESULT=$? @@ -617,7 +627,7 @@ remote_build() { rsync -e "ssh -p $PORT" -r $NODE:$TMPDIR/b$BUILDNR $TMPDIR/ RESULT=$? if [ $RESULT -ne 0 ] ; then - handle_unhandled "error when rsyncing remote build results" + handle_remote_error "when rsyncing remote build #$BUILDNR results from $NODE" fi fi ls -R $TMPDIR -- cgit v1.2.3-70-g09d2