[Piuparts-commits] [SCM] piatti.debian.org configuration files branch, master, updated. 148332ef45997ba3aaf38cc2c9a28441083bad49

Andreas Beckmann debian at abeckmann.de
Fri Dec 23 10:24:34 UTC 2011


The following commit has been merged in the master branch:
commit 3bfb105783344f01f4de1f9bd71f2dcfcfd8eb27
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Wed Dec 7 02:14:49 2011 +0100

    add a cron script for the daily processing
    
    * list new failure logs
    * run detect_well_known_errors
    * run piuparts-report
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/home/piupartsm/bin/report_newly_bugged_packages b/home/piupartsm/bin/generate_daily_report
similarity index 63%
copy from home/piupartsm/bin/report_newly_bugged_packages
copy to home/piupartsm/bin/generate_daily_report
index b8f5d9a..f74c690 100755
--- a/home/piupartsm/bin/report_newly_bugged_packages
+++ b/home/piupartsm/bin/generate_daily_report
@@ -1,17 +1,17 @@
 #!/bin/sh
 
 # Copyright © 2011 Andreas Beckmann <debian at abeckmann.de>
-# 
+#
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by the
 # Free Software Foundation; either version 2 of the License, or (at your
 # option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful, but
 # WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
 # Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License along
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
@@ -38,15 +38,36 @@ get_config_value()
 
 get_config_value MASTER global master-directory
 get_config_value SECTIONS global sections
+get_config_value HTDOCS global output-directory
+get_config_value URLBASE global urlbase http://piuparts.debian.org
 get_config_value PIUPARTS_PREFIX global prefix /org/piuparts.debian.org
 
 
-export PYTHONPATH=/org/piuparts.debian.org/lib/python2.6/dist-packages:/org/piuparts.debian.org/lib/python2.7/dist-packages
+export PYTHONPATH=$PIUPARTS_PREFIX/lib/python2.6/dist-packages:$PIUPARTS_PREFIX/lib/python2.7/dist-packages
 
+LOCKFILE=$HTDOCS/daily.lock
+if [ -e $LOCKFILE ]; then
+	echo "dialy.lock exists:"
+	ls -l $LOCKFILE
+	exit 1
+fi
+date > $LOCKFILE
+
+DAILYREPORT=$HTDOCS/dailyreport.txt
+>$DAILYREPORT
+
+# Failures of the day it should be, the rest is boring.
 for SECTION in $SECTIONS ; do
-	if [ -d $MASTER/$SECTION ]; then
-		echo $SECTION
-		cd $MASTER/$SECTION
-		/org/piuparts.debian.org/share/piuparts/piuparts-analyze
-	fi
-done
+	find $MASTER/$SECTION/fail $MASTER/$SECTION/bugged $MASTER/$SECTION/untestable -type f -name '*.log' -mtime -1 -exec ls -rt1 {} \;
+done | sed s#^$MASTER#$URLBASE# >> $DAILYREPORT
+
+date >> $DAILYREPORT
+~/bin/detect_well_known_errors >> $DAILYREPORT
+
+date >> $DAILYREPORT
+nice python $PIUPARTS_PREFIX/share/piuparts/piuparts-report >> $DAILYREPORT 2>&1
+
+date >> $DAILYREPORT
+cat $DAILYREPORT | mail -s piuparts-report $LOGNAME
+
+rm -f $LOCKFILE
diff --git a/home/piupartsm/crontab b/home/piupartsm/crontab
index ce2b14b..b951835 100644
--- a/home/piupartsm/crontab
+++ b/home/piupartsm/crontab
@@ -4,7 +4,7 @@
 # create reports once a day
 #  (dinstall runs 1|7|13|19:52, so this is long after mirror pushes...)
 #
-0 0 * * * ( /home/piupartsm/bin/detect_well_known_errors ; find /org/piuparts.debian.org/master/*/fail /org/piuparts.debian.org/master/*/bugged -type f -mtime -1 -name "*.log" -exec ls -rt1 {} \;|sed s#^/org/#http://#g | sed s#/master/#/#g ; PYTHONPATH=/org/piuparts.debian.org/lib/python2.6/dist-packages:/org/piuparts.debian.org/lib/python2.7/dist-packages nice python /org/piuparts.debian.org/share/piuparts/piuparts-report  2>&1 ) > /org/piuparts.debian.org/htdocs/dailyreport.txt ; cat /org/piuparts.debian.org/htdocs/dailyreport.txt | mail -s piuparts-report piupartsm # failures of the day it should be, the rest is boring.
+0 0 * * * $HOME/bin/generate_daily_report
 
 #
 # monitor slave session every hour

-- 
piatti.debian.org configuration files



More information about the Piuparts-commits mailing list