diff options
author | Holger Levsen <holger@layer-acht.org> | 2015-09-06 14:54:59 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-09-06 14:54:59 +0200 |
commit | 1e77676e09f56c7818bf142b154eba50b40a1094 (patch) | |
tree | c3877384555730ac695d6f13aee6ec64c644dfe9 /bin | |
parent | 605489040a5c4df7b119ba4dea80728c46136755 (diff) | |
download | jenkins.debian.net-1e77676e09f56c7818bf142b154eba50b40a1094.tar.xz |
reproducible: refactoring
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/reproducible_build.sh | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh index 479ba1af..b2a1d779 100755 --- a/bin/reproducible_build.sh +++ b/bin/reproducible_build.sh @@ -264,6 +264,14 @@ handle_reproducible() { fi } +handle_unhandled() { + MESSAGE="$BUILD_URL met an unhandled $1, please investigate." + echo "$MESSAGE" + irc_msg "$MESSAGE" + /srv/jenkins/bin/abort.sh + exit 0 +} + dbd_timeout() { local msg="$DIFFOSCOPE was killed after running into timeout after $1" if [ ! -s ./${DBDREPORT} ] ; then @@ -516,14 +524,12 @@ check_buildinfo() { if [ $RESULT -eq 148 ] ; then handle_404 elif [ $RESULT -ne 0 ] ; then - echo "Unhandled exit code from remote build job, please investigate." - /srv/jenkins/bin/abort.sh + handle_unhandled "exit code from remote build job" fi rsync -e "ssh -p $PORT1" -r $NODE1:$TMPDIR/b1 $TMPDIR/ RESULT=$? if [ $RESULT -ne 0 ] ; then - echo "Unhandled error when rsyncing remote build job results, please investigate." - /srv/jenkins/bin/abort.sh + handle_unhandled "error when rsyncing remote build results" fi ls -R $TMPDIR ssh -p $PORT1 $NODE1 "rm -r $TMPDIR" @@ -552,14 +558,12 @@ build_rebuild() { if [ $RESULT -eq 148 ] ; then handle_404 elif [ $RESULT -ne 0 ] ; then - echo "Unhandled exit code from remote build job, please investigate." - /srv/jenkins/bin/abort.sh + handle_unhandled "exit code from remote build job" fi rsync -e "ssh -p $PORT1" -r $NODE1:$TMPDIR/b1 $TMPDIR/ RESULT=$? if [ $RESULT -ne 0 ] ; then - echo "Unhandled error when rsyncing remote build job results, please investigate." - /srv/jenkins/bin/abort.sh + handle_unhandled "error when rsyncing remote build results" fi ls -R $TMPDIR ssh -p $PORT1 $NODE1 "rm -r $TMPDIR" @@ -586,14 +590,12 @@ build_rebuild() { if [ $RESULT -eq 148 ] ; then handle_404 elif [ $RESULT -ne 0 ] ; then - echo "Unhandled exit code from remote build job, please investigate." - /srv/jenkins/bin/abort.sh + handle_unhandled "exit code from remote build job" fi rsync -e "ssh -p $PORT2" -r $NODE2:$TMPDIR/b2 $TMPDIR/ RESULT=$? if [ $RESULT -ne 0 ] ; then - echo "Unhandled error when rsyncing remote build job results, please investigate." - /srv/jenkins/bin/abort.sh + handle_unhandled "error when rsyncing remote build results" fi ls -R $TMPDIR ssh -p $PORT2 $NODE2 "rm -r $TMPDIR" |