summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-09-10 15:53:57 +0200
committerHolger Levsen <holger@layer-acht.org>2015-09-10 15:53:57 +0200
commit513119857db3a70c84a47a93af2a181d83faa592 (patch)
tree45f6c7b5acabf170f62e5ae7d75f0d67a5629aa7
parent877b3ae54a75f1d1d2c791c9231936e4b4ed7090 (diff)
downloadjenkins.debian.net-513119857db3a70c84a47a93af2a181d83faa592.tar.xz
reproducible maintenance: upgrade schroot and pbuilder first, to keep nodes more in sync
-rwxr-xr-xbin/reproducible_maintenance.sh105
1 files changed, 54 insertions, 51 deletions
diff --git a/bin/reproducible_maintenance.sh b/bin/reproducible_maintenance.sh
index 798bde22..e96e6397 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."