summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtsp/common.sh1
-rw-r--r--tsp/html_head18
-rw-r--r--tsp/html_tail3
-rwxr-xr-xtsp/jobs/publish.sh5
4 files changed, 27 insertions, 0 deletions
diff --git a/tsp/common.sh b/tsp/common.sh
index 82ea38b..7e07d08 100755
--- a/tsp/common.sh
+++ b/tsp/common.sh
@@ -38,6 +38,7 @@ WS_PUBLISH="${WS}/publish"
DBNAME="results.db3"
DBPATH="${WS_PUBLISH}/${DBNAME}"
+WWW_PUBLISH="${WS_PUBLISH}/current_status.html"
TMP_POLL="/tmp/tl-master-poll"
TMP_MASTER="/tmp/tl-master"
diff --git a/tsp/html_head b/tsp/html_head
new file mode 100644
index 0000000..e5b8458
--- /dev/null
+++ b/tsp/html_head
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+table, th, td {
+ border: 1px solid black;
+ border-collapse: collapse;
+}
+th, td {
+ padding: 5px;
+}
+th {
+ text-align: left;
+}
+</style>
+</head>
+<body>
+<table>
diff --git a/tsp/html_tail b/tsp/html_tail
new file mode 100644
index 0000000..81d8c88
--- /dev/null
+++ b/tsp/html_tail
@@ -0,0 +1,3 @@
+</table>
+</body>
+</html>
diff --git a/tsp/jobs/publish.sh b/tsp/jobs/publish.sh
index 88ea53d..018399a 100755
--- a/tsp/jobs/publish.sh
+++ b/tsp/jobs/publish.sh
@@ -143,6 +143,11 @@ sqlite3 "${DBPATH}" "insert into test values (NULL,'$SR', CURRENT_TIMESTAMP,\
(select r.rid from result r where r.rname='$TAG'),\
(select d.did from device d where d.dname='$TARGET'));"
+# Publish to www
+cat "${TSP_DIR}/html_head" > "${WWW_PUBLISH}"
+sqlite3 -html -header "${DBPATH}" "SELECT * FROM currentstatus;" >> "${WWW_PUBLISH}"
+cat "${TSP_DIR}/html_tail" >> "${WWW_PUBLISH}"
+
# Clean up workspace
ssh tl-pwb "rm -rf \"${WORKSPACE}\"; mkdir -p \"${WORKSPACE}\"" || echo "rm failed"