[Qa-jenkins-scm] [jenkins.debian.net] 01/03: reproducible: remote builds: deal with 404 properly

Holger Levsen holger at moszumanska.debian.org
Sun Sep 6 12:55:43 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit ce16a75c785cb97137d3d0328fd60374442c9c70
Author: Holger Levsen <holger at layer-acht.org>
Date:   Sun Sep 6 14:35:53 2015 +0200

    reproducible: remote builds: deal with 404 properly
---
 TODO                      |  1 -
 bin/reproducible_build.sh | 26 +++++++++++++++++++++++++-
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/TODO b/TODO
index 545abdc..280db49 100644
--- a/TODO
+++ b/TODO
@@ -239,7 +239,6 @@ properties:
 * reproducible_build.sh changes needed:
 ** diffoscope needs to be run on the target arch...
 *** can't this be run via qemu on the host?
-* exit 404 / * detect "bad gateway" as in https://jenkins.debian.net/job/reproducible_builder_amd64_4/222/ and deal with it properly
 * deal with rsync problems as in https://jenkins.debian.net/job/reproducible_builder_armhf_4/61/:
 ----
 jenkins_node_wrapper.sh[14148] remote_host called with rsync --server --sender -re.iLsfx . /srv/reproducible-results/tmp.QhHoGHUUnP/b1
diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh
index 461fbf1..273291d 100755
--- a/bin/reproducible_build.sh
+++ b/bin/reproducible_build.sh
@@ -409,7 +409,7 @@ get_source_package() {
 		if [ "$MODE" = "legacy" ] || [ "$MODE" = "ng" ] ; then
 			handle_404
 		else
-			exit 404	# FIXME: this is unhandled atm
+			exit 404
 		fi
 	fi
 	VERSION="$(grep '^Version: ' ${SRCPACKAGE}_*.dsc| head -1 | egrep -v '(GnuPG v|GnuPG/MacGPG2)' | cut -d ' ' -f2-)"
@@ -511,6 +511,14 @@ check_buildinfo() {
 			first_build
 		else
 			ssh -p $PORT1 $NODE1 /srv/jenkins/bin/reproducible_build.sh 1 ${SRCPACKAGE} ${SUITE} ${TMPDIR}
+			RESULT=$?
+			# 404-256=148... (ssh 'really' only 'supports' exit codes below 255...)
+			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
+			fi
 			rsync -e "ssh -p $PORT1" -r $NODE1:$TMPDIR/b1 $TMPDIR/
 			ls -R $TMPDIR
 			ssh -p $PORT1 $NODE1 "rm -r $TMPDIR"
@@ -534,6 +542,14 @@ build_rebuild() {
 		first_build
 	else
 		ssh -p $PORT1 $NODE1 /srv/jenkins/bin/reproducible_build.sh 1 ${SRCPACKAGE} ${SUITE} ${TMPDIR}
+		RESULT=$?
+		# 404-256=148... (ssh 'really' only 'supports' exit codes below 255...)
+		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
+		fi
 		rsync -e "ssh -p $PORT1" -r $NODE1:$TMPDIR/b1 $TMPDIR/
                 ls -R $TMPDIR
 		ssh -p $PORT1 $NODE1 "rm -r $TMPDIR"
@@ -555,6 +571,14 @@ build_rebuild() {
 			second_build
 		else
 			ssh -p $PORT2 $NODE2 /srv/jenkins/bin/reproducible_build.sh 2 ${SRCPACKAGE} ${SUITE} ${TMPDIR}
+			RESULT=$?
+			# 404-256=148... (ssh 'really' only 'supports' exit codes below 255...)
+			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
+			fi
 			rsync -e "ssh -p $PORT2" -r $NODE2:$TMPDIR/b2 $TMPDIR/
 	                ls -R $TMPDIR
 			ssh -p $PORT2 $NODE2 "rm -r $TMPDIR"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list