Fix archiving script to trim the end of the log file 63/41363/1
authorThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 6 Jul 2016 00:27:10 +0000 (20:27 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 6 Jul 2016 00:27:19 +0000 (20:27 -0400)
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>
jjb/include-raw-deploy-archives.sh

index 1ecfc069d4b014b50d9ff7b7d241b19ea1ea27cd..572e2cb0324090f88e3024f94b7f33d02322de63 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" \