summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2014-08-12 15:22:40 +0100
committerMichael Drake <michael.drake@codethink.co.uk>2014-08-12 15:22:40 +0100
commitd658a1b1e533269abfc7504eb5c4ae0278d7e5be (patch)
treef087f939ef35edaabe91f76894b7deb10d636c64
parente39619726e3fd1c8665eb8c7cf22bb1c7a12e315 (diff)
downloaddefinitions-baserock/michaeldrake/mason-devel.tar.gz
Report last time we checked for updates.baserock/michaeldrake/mason-devel
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.
-rwxr-xr-xmason/mason-report.sh32
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"