diff options
-rwxr-xr-x | mason/mason-report.sh | 32 |
1 files 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; } </style> </head> @@ -148,7 +158,8 @@ code { <!--INSERTION POINT--> </table> <div id="footer"> -<p>Generated by Mason</p> +<p>Last checked for updates at: <code>....-..-.. ..:..:..</code></p> +<p class="about">Generated by Mason | Powered by Baserock</p> </div> </body> </html> @@ -183,8 +194,21 @@ update_report() { sed -i 's/<!--INSERTION POINT-->/<!--INSERTION POINT-->\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>....-..-.. ..:..:..<\/code>/<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" |