[Qa-jenkins-scm] [jenkins.debian.net] 01/02: reproducible maintenance: upgrade schroot and pbuilder first, to keep nodes more in sync

Holger Levsen holger at moszumanska.debian.org
Thu Sep 10 13:59:39 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 513119857db3a70c84a47a93af2a181d83faa592
Author: Holger Levsen <holger at layer-acht.org>
Date:   Thu Sep 10 15:53:57 2015 +0200

    reproducible maintenance: upgrade schroot and pbuilder first, to keep nodes more in sync
---
 bin/reproducible_maintenance.sh | 105 +++++++++++++++++++++-------------------
 1 file changed, 54 insertions(+), 51 deletions(-)

diff --git a/bin/reproducible_maintenance.sh b/bin/reproducible_maintenance.sh
index 798bde2..e96e639 100755
--- a/bin/reproducible_maintenance.sh
+++ b/bin/reproducible_maintenance.sh
@@ -40,6 +40,60 @@ if [ "$HOSTNAME" = "jenkins" ] ; then
 	cp -v $PACKAGES_DB $BASE/
 fi
 
+echo "$(date -u) - updating the schroots and pbuilder now..."
+set +e
+ARCH=$(dpkg --print-architecture)
+for s in $SUITES ; do
+	if [ "$ARCH" = "armhf" ] && [ "$s" != "unstable" ] ; then
+		continue
+	fi
+	#
+	# schroot update
+	#
+	echo "$(date -u) - updating the $s/$ARCH schroot now."
+	for i in 1 2 3 ; do
+		schroot --directory /root -u root -c source:jenkins-reproducible-$s -- apt-get update
+		RESULT=$?
+		if [ $RESULT -eq 1 ] ; then
+			# sleep 31-100 secs
+			echo "Sleeping some time... (to workaround network problems like 'Hash Sum mismatch'...)"
+			/bin/sleep $(echo "scale=1 ; ($(shuf -i 1-700 -n 1)/10)+30" | bc )
+			echo "$(date -u) - Retrying to update the $s/$ARCH schroot."
+		elif [ $RESULT -eq 0 ] ; then
+			continue
+		fi
+	done
+	if [ $RESULT -eq 1 ] ; then
+		echo "Warning: failed to update the $s/$ARCH schroot."
+		DIRTY=true
+	fi
+	#
+	# pbuilder update
+	#
+	echo "$(date -u) - updating pbuilder for $s/$ARCH now."
+	# use host apt proxy configuration for pbuilder
+	if [ ! -z "$http_proxy" ] ; then
+		pbuilder_http_proxy="--http-proxy $http_proxy"
+	fi
+	for i in 1 2 3 ; do
+		sudo pbuilder --update $pbuilder_http_proxy --basetgz /var/cache/pbuilder/$s-reproducible-base.tgz
+		RESULT=$?
+		if [ $RESULT -eq 1 ] ; then
+			# sleep 31-100 secs
+			echo "Sleeping some time... (to workaround network problems like 'Hash Sum mismatch'...)"
+			/bin/sleep $(echo "scale=1 ; ($(shuf -i 1-700 -n 1)/10)+30" | bc )
+			echo "$(date -u) - Retrying to update pbuilder for $s/$ARCH."
+		elif [ $RESULT -eq 0 ] ; then
+			continue
+		fi
+	done
+	if [ $RESULT -eq 1 ] ; then
+		echo "Warning: failed to update pbuilder for $s/$ARCH."
+		DIRTY=true
+	fi
+done
+set -e
+
 # delete old temp directories
 OLDSTUFF=$(find $REP_RESULTS -maxdepth 1 -type d -name "tmp.*" -mtime +2 -exec ls -lad {} \;)
 if [ ! -z "$OLDSTUFF" ] ; then
@@ -271,57 +325,6 @@ if ! $DIRTY ; then
 	echo
 fi
 
-echo "$(date -u) - updating the schroots and pbuilder now..."
-set +e
-ARCH=$(dpkg --print-architecture)
-for s in $SUITES ; do
-	if [ "$ARCH" = "armhf" ] && [ "$s" != "unstable" ] ; then
-		continue
-	fi
-	#
-	# schroot update
-	#
-	echo "$(date -u) - updating the $s/$ARCH schroot now."
-	for i in 1 2 3 ; do
-		schroot --directory /root -u root -c source:jenkins-reproducible-$s -- apt-get update
-		RESULT=$?
-		if [ $RESULT -eq 1 ] ; then
-			# sleep 31-100 secs
-			echo "Sleeping some time... (to workaround network problems like 'Hash Sum mismatch'...)"
-			/bin/sleep $(echo "scale=1 ; ($(shuf -i 1-700 -n 1)/10)+30" | bc )
-			echo "$(date -u) - Retrying to update the $s/$ARCH schroot."
-		elif [ $RESULT -eq 0 ] ; then
-			continue
-		fi
-	done
-	if [ $RESULT -eq 1 ] ; then
-		echo "Warning: failed to update the $s/$ARCH schroot."
-	fi
-	#
-	# pbuilder update
-	#
-	echo "$(date -u) - updating pbuilder for $s/$ARCH now."
-	# use host apt proxy configuration for pbuilder
-	if [ ! -z "$http_proxy" ] ; then
-		pbuilder_http_proxy="--http-proxy $http_proxy"
-	fi
-	for i in 1 2 3 ; do
-		sudo pbuilder --update $pbuilder_http_proxy --basetgz /var/cache/pbuilder/$s-reproducible-base.tgz
-		RESULT=$?
-		if [ $RESULT -eq 1 ] ; then
-			# sleep 31-100 secs
-			echo "Sleeping some time... (to workaround network problems like 'Hash Sum mismatch'...)"
-			/bin/sleep $(echo "scale=1 ; ($(shuf -i 1-700 -n 1)/10)+30" | bc )
-			echo "$(date -u) - Retrying to update pbuilder for $s/$ARCH."
-		elif [ $RESULT -eq 0 ] ; then
-			continue
-		fi
-	done
-	if [ $RESULT -eq 1 ] ; then
-		echo "Warning: failed to update pbuilder for $s/$ARCH."
-	fi
-done
-set -e
 echo "$(date -u) - the end."
 
 

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