[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] reproducible Debian: compress worker's console.logs
Holger Levsen
gitlab at salsa.debian.org
Mon Jul 30 08:19:04 BST 2018
Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net
Commits:
9f7103b7 by Holger Levsen at 2018-07-30T07:18:54Z
reproducible Debian: compress worker's console.logs
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
2 changed files:
- bin/cgi-bin/nph-logwatch
- bin/reproducible_worker.sh
Changes:
=====================================
bin/cgi-bin/nph-logwatch
=====================================
--- a/bin/cgi-bin/nph-logwatch
+++ b/bin/cgi-bin/nph-logwatch
@@ -1,6 +1,6 @@
#!/bin/bash
-# Copyright © 2017 Holger Levsen (holger at layer-acht.org)
+# Copyright © 2017-2018 Holger Levsen (holger at layer-acht.org)
# released under the GPLv=2
set -e
@@ -29,8 +29,8 @@ if [ ! -d $DIR ] ; then
echo "$DIR does not exist."
#echo "Wanted $TARGET but $DIR does not exist."
exit 0
-elif [ ! -f $FILE ] ; then
- echo "$FILE does not exist."
+elif [ ! -f $FILE ] && [ ! -f $FILE.gz ] ; then
+ echo "Neither $FILE nor FILE.gz exists."
#echo "Wanted $TARGET but $FILE does not exist."
exit 0
fi
@@ -43,18 +43,26 @@ let NEW_BUILD=$BUILD+1
#
# if this ain't the latest build, just cat it's logfile
#
-if [ -e $DIR/$NEW_BUILD/console.log ] ; then
- cat $FILE
+if [ -e $DIR/$NEW_BUILD/console.log.gz ] ; then
+ zcat $FILE
#
# if the worker ain't running, just cat the logfile
#
elif [ ! -z "$(ps fax|grep -v grep|grep 'reproducible_worker $WORKER.sh ')" ] ; then
- cat $FILE
+ if [ -f $FILE.gz ] ; then
+ cat $FILE
+ else
+ zcat $FILE.gz
+ fi
#
# FIXME: we should really just convert 'latest' into a number here and use the tail below…
#
elif [ "$BUILD" = "latest" ] ; then
- cat $FILE
+ if [ -f $FILE.gz ] ; then
+ cat $FILE
+ else
+ zcat $FILE.gz
+ fi
else
#
# else, we tail the logfile and kill the tail process, once the next build
=====================================
bin/reproducible_worker.sh
=====================================
--- a/bin/reproducible_worker.sh
+++ b/bin/reproducible_worker.sh
@@ -98,6 +98,7 @@ while true ; do
echo
RETCODE=0
/srv/jenkins/bin/reproducible_build.sh $NODE1 $NODE2 >$BUILD_BASE/$BUILD_ID/console.log 2>&1 || RETCODE=$?
+ gzip $BUILD_BASE/$BUILD_ID/console.log || true
echo
[ "$RETCODE" -eq 0 ] || notify_log_of_failure
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/9f7103b74d7f62c152afff4f0863373d1883bb65
--
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/9f7103b74d7f62c152afff4f0863373d1883bb65
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20180730/2d3c0f76/attachment-0001.html>
More information about the Qa-jenkins-scm
mailing list