From b666690fc622494c11204be7c9eba9018bde24dd Mon Sep 17 00:00:00 2001 From: Anil Belur Date: Tue, 12 Jul 2016 11:25:08 +0530 Subject: [PATCH] Improve archive-build macro to gzip any text file Change-Id: I5a782147ec7f11fa353fbf01ea6d7fc117757346 Signed-off-by: Anil Belur Signed-off-by: Thanh Ha --- include-raw-deploy-archives.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 -- 2.16.6