Fix archiving script to trim the end of the log file 86/4086/1
authorThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 6 Jul 2016 00:27:10 +0000 (20:27 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Sat, 4 Mar 2017 19:13:24 +0000 (14:13 -0500)
Because the console log is still running while we are downloading it to
archive to logs.opendaylight.org it ends abruptly and causes confusion.
This patch trims the log so it will have a natural end to it's log.

Change-Id: Ic68828d2209a1c95e3c8282a82bc12f3138105a6
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
include-raw-deploy-archives.sh

index 1ecfc06..572e2cb 100644 (file)
@@ -50,10 +50,16 @@ cat > deploy-archives.xml <<EOF
 EOF
 
 mkdir -p $ARCHIVES_DIR
-mv $WORKSPACE/archives/ $ARCHIVES_DIR
+# Ignore logging if archives doesn't exist
+mv $WORKSPACE/archives/ $ARCHIVES_DIR > /dev/null 2>&1
 touch $ARCHIVES_DIR/_build-details.txt
 echo "build-url: ${{BUILD_URL}}" >> $ARCHIVES_DIR/_build-details.txt
+
+# Magic string used to trim console logs at the appropriate level during wget
+echo "-----END_OF_BUILD-----"
 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" \