[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible Debian: refactor

Holger Levsen holger at layer-acht.org
Wed Jan 11 01:25:04 UTC 2017


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 9c938ed882c3c2fbc792e431ee12ec41e077f737
Author: Holger Levsen <holger at layer-acht.org>
Date:   Wed Jan 11 02:24:48 2017 +0100

    reproducible Debian: refactor
    
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 bin/reproducible_maintenance.sh | 53 ++++++++++++++++++++++-------------------
 1 file changed, 28 insertions(+), 25 deletions(-)

diff --git a/bin/reproducible_maintenance.sh b/bin/reproducible_maintenance.sh
index ce8bbc9..1284a47 100755
--- a/bin/reproducible_maintenance.sh
+++ b/bin/reproducible_maintenance.sh
@@ -421,36 +421,39 @@ if [ "$HOSTNAME" = "$MAINNODE" ] && [ $(date -u +%H) -eq 0 ]  ; then
 		if [ -s $PROBLEM ] ; then
 			TMPFILE=$(mktemp --tmpdir=$TEMPDIR maintenance-XXXXXXXXXXXX)
 			if [ "$(dirname $PROBLEM)" = "/var/log/jenkins" ] ; then
+				if [ "$(basename $PROBLEM)" = "reproducible-diskspace-issues.log" ]; then
+					echo "diskspace issues should always be investigated." > $TMPFILE
+				elif [ "$(basename $PROBLEM)" != "postgresql-9.4-main.log " ]; then
+					echo "A few entries per day are normal, a few dozens or hundreds probably not." > $TMPFILE
+				fi
+				if grep -q https $PROBLEM ; then
+					echo "$(grep -c https $PROBLEM) entries found:"
+					if [ "$(basename $PROBLEM)" != "reproducible-remote-error.log" ]; then
+						OTHERPROJECTS=""
+					else
+						OTHERPROJECTS="archlinux fedora"
+					fi
+					for a in $ARCHS $OTHERPROJECTS; do
+						echo "- $(grep https $PROBLEM|grep -c _$a) from $a." >> $TMPFILE
+					done
+				elif grep -q 'stale builds found' $PROBLEM ; then
+					echo "$(grep -c 'stale builds found' $PROBLEM || echo 0) entries found:" >> $TMPFILE
+					for a in $ARCHS ; do
+							echo "- $(grep -c ${a}_ $PROBLEM) from $a." >> $TMPFILE
+					done
+				fi
+				echo >> $TMPFILE
 				# maybe we should use logrotate for our jenkins logs too…
-				mv $PROBLEM $TMPFILE
+				cat $PROBLEM >> $TMPFILE
+				rm $PROBLEM
 			else
 				# regular logfile, logrotate is used (and the file ain't owned by jenkins)
 				# only care for yesterday's entries:
-				grep $(date -u -d "1 day ago" '+%Y-%m-%d') $PROBLEM > $TMPFILE || echo "no problems yesterday…" > $TMPFILE
+				( grep $(date -u -d "1 day ago" '+%Y-%m-%d') $PROBLEM || echo "no problems yesterday…" ) > $TMPFILE
+			fi
+			if [ -s $TMPFILE ] ; then
+				cat $TMPFILE | mail -s "$(basename $PROBLEM) found" qa-jenkins-scm at lists.alioth.debian.org
 			fi
-			( if [ "$(basename $PROBLEM)" = "reproducible-diskspace-issues.log" ]; then
-				echo "diskspace issues should always be investigated."
-			  elif [ "$(basename $PROBLEM)" != "postgresql-9.4-main.log " ]; then
-				echo "A few entries per day are normal, a few dozens or hundreds probably not."
-			  fi
-			  if grep -q https $TMPFILE ; then
-				echo "$(grep -c https $TMPFILE) entries found:"
-				if [ "$(basename $PROBLEM)" != "reproducible-remote-error.log" ]; then
-					OTHERPROJECTS=""
-				else
-					OTHERPROJECTS="archlinux fedora"
-				fi
-				for a in $ARCHS $OTHERPROJECTS; do
-						echo "- $(grep https $TMPFILE|grep -c _$a) from $a."
-				done
-			  elif grep -q 'stale builds found' $TMPFILE ; then
-				echo "$(grep -c 'stale builds found' $TMPFILE || true) entries found:"
-				for a in $ARCHS ; do
-						echo "- $(grep -c ${a}_ $TMPFILE) from $a."
-				done
-			  fi
-			  echo
-			  cat $TMPFILE ) | mail -s "$(basename $PROBLEM) found" qa-jenkins-scm at lists.alioth.debian.org
 			rm -f $TMPFILE
 		fi
 	done

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