Files
project-config/jenkins/scripts/grab_console_log.sh
Joshua Hesketh ca9b73efba Grab the html version of console log
Currently we are only grabbing the text output from Jenkins. However,
this doesn't have timestamps which isn't ideal. We can use the
internal url that is used by Jenkins to generate its web page to
fetch the console logs with timestamps and formatting.

We need to surround the output in pre tags since os-loganlayze uses
that to determine whether to escape the html or not.

Change-Id: I7584ea37f84521d65f327f327ff5e47b096fa230
2014-10-07 20:07:25 +02:00

19 lines
591 B
Bash
Executable File

#!/bin/bash -xe
echo "Grabbing consoleLog"
# Get the plain text version (does not contain links or timestamps)
# (Disabled for now)
#console_log_path='consoleText'
#wget -O /tmp/console.txt --no-check-certificate $BUILD_URL$console_log_path
# Grab the HTML version of the log (includes timestamps)
console_log_path='logText/progressiveHtml'
wget -O /tmp/console.html --no-check-certificate $BUILD_URL$console_log_path
# We need to add <pre> tags around the output for log-osanalyze to not escape
# the content
sed -i '1s/^/<pre>\n/' /tmp/console.html
echo "</pre>" >> /tmp/console.html