]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
add warning if there are too many images
authorHolger Levsen <holger@layer-acht.org>
Fri, 8 Mar 2013 10:34:59 +0000 (11:34 +0100)
committerHolger Levsen <holger@layer-acht.org>
Fri, 8 Mar 2013 10:34:59 +0000 (11:34 +0100)
liveboot_garbage_collection.sh
logparse/default.rules [new file with mode: 0644]

index e1a2bfe8dcaee5cfc12685f33af9e2aef3620e73..1c3dddd37fb0439d1718a2e6e7fde1798bd124c0 100755 (executable)
@@ -9,6 +9,7 @@ set -e
 
 # no configuration below this block
 AMOUNT_TO_KEEP=15
+WARNING_TRESHOLD=10
 LIVEBOOT_IMAGE_PATH="/srv/mirror/liveboot"
 
 
@@ -32,6 +33,9 @@ for DIRECTORY in $FIRST_PASS ; do
                SECOND_PASS="$SECOND_PASS $DIRECTORY"
        fi
 done
+if  [ $KEPT -gt $WARNING_TRESHOLD ] ; then
+       echo "Warning: $KEPT images being kept, while we can only keep $AMOUNT_TO_KEEP at maximum. Please delete some rejected images set to 'keep'. Ask Fabian for help, if needed."
+fi
 for DIRECTORY in $SECOND_PASS ; do
        echo -n "$DIRECTORY: "
        if  [ $KEPT -le $AMOUNT_TO_KEEP ] ; then
diff --git a/logparse/default.rules b/logparse/default.rules
new file mode 100644 (file)
index 0000000..41ed737
--- /dev/null
@@ -0,0 +1,16 @@
+# see https://wiki.jenkins-ci.org/display/JENKINS/Log+Parser+Plugin
+
+# ok despite warnings
+ok /not really/
+ok /.+Warning: Permanently added .+ (RSA) to the list of known hosts./
+
+# match line starting with 'error ', case-insensitive
+error /(?i)^error /
+
+# list of warnings here...
+warning /[Ww]arning/
+warning /WARNING/
+
+# create a quick access link to lines in the report containing 'INFO'
+info /INFO/
+