summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_maintainance.sh
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-02-16 20:42:56 +0100
committerHolger Levsen <holger@layer-acht.org>2015-02-16 20:42:56 +0100
commitcc6a4cf994c659c6eea3c955327110bf8eb4572a (patch)
tree67fe7e03e90d139d75d9cb5659caab0d9b13a1a0 /bin/reproducible_maintainance.sh
parentb1fe00e4f687c589c9ac1cba1899b34ef3f5769d (diff)
downloadjenkins.debian.net-cc6a4cf994c659c6eea3c955327110bf8eb4572a.tar.xz
reproducible: automatically reschedule packages with failed builds due to network problems
Diffstat (limited to 'bin/reproducible_maintainance.sh')
-rwxr-xr-xbin/reproducible_maintainance.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/reproducible_maintainance.sh b/bin/reproducible_maintainance.sh
index 40948db4..3f60dafe 100755
--- a/bin/reproducible_maintainance.sh
+++ b/bin/reproducible_maintainance.sh
@@ -67,6 +67,22 @@ if [ ! -z "$OLDSTUFF" ] ; then
DIRTY=true
fi
+# find failed builds due to network problems and reschedule them
+# only grep through the last 5h (300 minutes) of builds...
+# this job runs every 4h
+FAILED_BUILDS=$(find /var/lib/jenkins/userContent/rbuild -type f ! -mmin +300 -exec egrep -l -e "E: Failed to fetch.*Connection failed" -e "E: Failed to fetch.*Size mismatch" {} \;)
+if [ ! -z "$FAILED_BUILDS" ] ; then
+ echo
+ echo "Warning: the following failed builds have been found"
+ echo "$FAILED_BUILDS"
+ echo
+ echo "Rescheduling packages: "
+ ( for PKG in $(echo $FAILED_BUILDS | sed "s# #\n#g" | cut -d "/" -f7 | cut -d "_" -f1) ; do echo $PKG ; done ) | xargs /srv/jenkins/bin/reproducible_schedule_on_demand.sh
+ echo
+ DIRTY=true
+fi
+
+
# find processes which should not be there
HAYSTACK=$(mktemp)
RESULT=$(mktemp)