From d658a1b1e533269abfc7504eb5c4ae0278d7e5be Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Tue, 12 Aug 2014 15:22:40 +0100 Subject: Report last time we checked for updates. Now the timestamp of the last time we looked for any changes in the definitions.git repository is put into the footer area. It is highlighted for visibility. This makes it easier to see that the mason system is still running, but that there is nothing new to build. --- mason/mason-report.sh | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/mason/mason-report.sh b/mason/mason-report.sh index a928f098..c18e68ac 100755 --- a/mason/mason-report.sh +++ b/mason/mason-report.sh @@ -127,10 +127,20 @@ code { border-top: #888 1px solid; font-size: 80%; padding: 0; - text-align: right; position: fixed; bottom: 0; width: 100%; + display: table; +} +#footer p { + padding: 1.3em; + display: table-cell; +} +#footer p code { + font-size: 110%; +} +#footer p.about { + text-align: right; } @@ -148,7 +158,8 @@ code { @@ -183,8 +194,21 @@ update_report() { sed -i 's//\n'"$(sed_escape "$msg")"'/' $REPORT_PATH } +update_report_time() { + # Give function params sensible names + build_start_time="$1" + + # If the report file exists, update the last-checked-for-updates time + if [ -f $REPORT_PATH ]; then + sed -i 's/....-..-.. ..:..:..<\/code>/'"$(sed_escape "$build_start_time")"'<\/code>/' $REPORT_PATH + fi +} + START_TIME=`date +%Y-%m-%d\ %T` +update_report_time "$START_TIME" +cp "$REPORT_PATH" "$SERVER_PATH/index.html" + logfile="$(mktemp)" /root/mason.sh 2>&1 | tee "$logfile" case "${PIPESTATUS[0]}" in @@ -224,5 +248,5 @@ update_report "$START_TIME" \ # cp "$REPORT_PATH" "$SERVER_PATH/index.html" -mkdir /srv/mason/log -mv "$logfile" /srv/mason/log/"$SHA1--$START_TIME.log" +mkdir "$SERVER_PATH/log" +mv "$logfile" "$SERVER_PATH/log/$SHA1--$START_TIME.log" -- cgit v1.2.1