[Qa-jenkins-scm] [jenkins.debian.net] 01/02: reproducible: really deal with ssh failures gracefully

Holger Levsen holger at moszumanska.debian.org
Mon Sep 7 02:05:33 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 170bc415fe017af3cd9e59e4b0991992e5481618
Author: Holger Levsen <holger at layer-acht.org>
Date:   Mon Sep 7 04:03:47 2015 +0200

    reproducible: really deal with ssh failures gracefully
---
 bin/reproducible_build.sh | 6 ++++++
 bin/schroot-create.sh     | 1 +
 2 files changed, 7 insertions(+)

diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh
index b2a1d77..b848300 100755
--- a/bin/reproducible_build.sh
+++ b/bin/reproducible_build.sh
@@ -518,6 +518,7 @@ check_buildinfo() {
 		if [ "$MODE" = "legacy" ] ; then
 			first_build
 		else
+			set +e
 			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...)
@@ -533,6 +534,7 @@ check_buildinfo() {
 			fi
 			ls -R $TMPDIR
 			ssh -p $PORT1 $NODE1 "rm -r $TMPDIR"
+			set -e
 		fi
 		grep-dctrl -s Build-Environment -n ${SRCPACKAGE} ./b1/$BUILDINFO > $TMPFILE1
 		set +e
@@ -552,6 +554,7 @@ build_rebuild() {
 	if [ "$MODE" = "legacy" ] ; then
 		first_build
 	else
+		set +e
 		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...)
@@ -567,6 +570,7 @@ build_rebuild() {
 		fi
 		ls -R $TMPDIR
 		ssh -p $PORT1 $NODE1 "rm -r $TMPDIR"
+		set -e
 	fi
 	if [ ! -f b1/${SRCPACKAGE}_${EVERSION}_${ARCH}.changes ] && [ -f b1/${SRCPACKAGE}_*_${ARCH}.changes ] ; then
 			echo "Version mismatch between main node and first build node, aborting. Please upgrade the schroots..." | tee -a ${RBUILDLOG}
@@ -584,6 +588,7 @@ build_rebuild() {
 		if [ "$MODE" = "legacy" ] ; then
 			second_build
 		else
+			set +e
 			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...)
@@ -599,6 +604,7 @@ build_rebuild() {
 			fi
 	                ls -R $TMPDIR
 			ssh -p $PORT2 $NODE2 "rm -r $TMPDIR"
+			set -e
 		fi
 		if [ -f b2/${SRCPACKAGE}_${EVERSION}_${ARCH}.changes ] ; then
 			# both builds were fine, i.e., they did not FTBFS.
diff --git a/bin/schroot-create.sh b/bin/schroot-create.sh
index 2d4bc3c..3c56256 100755
--- a/bin/schroot-create.sh
+++ b/bin/schroot-create.sh
@@ -177,6 +177,7 @@ sudo mv $CHROOT_TARGET $SCHROOT_BASE/"$TARGET"
 
 if [ -d $SCHROOT_BASE/"$TARGET"-"$rand" ] ; then
 	sudo rm -rf --one-file-system $SCHROOT_BASE/"$TARGET"-"$rand" || ( echo "Warning: $SCHROOT_BASE/${TARGET}-$rand could not be fully removed." ; fuser -mv $SCHROOT_BASE/${TARGET}-$rand ; ls $SCHROOT_BASE/${TARGET}-$rand -la )
+	# idea: ignore if 0 files are in there…
 fi
 
 # write the schroot config

-- 
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