From: Anil Belur Date: Tue, 12 Jul 2016 05:55:08 +0000 (+0530) Subject: Improve archive-build macro to gzip any text file X-Git-Tag: v0.0.6~19 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F83%2F4083%2F1;p=releng%2Flftools.git Improve archive-build macro to gzip any text file Change-Id: I5a782147ec7f11fa353fbf01ea6d7fc117757346 Signed-off-by: Anil Belur Signed-off-by: Thanh Ha --- diff --git a/include-raw-deploy-archives.sh b/include-raw-deploy-archives.sh index 56a77eae..79a86d5a 100644 --- a/include-raw-deploy-archives.sh +++ b/include-raw-deploy-archives.sh @@ -75,11 +75,12 @@ wget -O $ARCHIVES_DIR/_console-output.log ${{BUILD_URL}}consoleText sed -i '/^-----END_OF_BUILD-----$/,$d' $ARCHIVES_DIR/_console-output.log gzip $ARCHIVES_DIR/*.txt $ARCHIVES_DIR/*.log -# find and gzip all text files -find $ARCHIVES_DIR -name "*.txt" \ - -o -name "*.log" \ - -o -name "*.html" \ - | xargs gzip +# find and gzip any 'text' files +find $ARCHIVES_DIR -type f -print0 \ + | xargs -0r file \ + | egrep -e ':.*text.*' \ + | cut -d: -f1 \ + | xargs -d'\n' -r gzip zip -r archives.zip $JENKINS_HOSTNAME/ du -sh archives.zip