From a58847642e9c4665d2cc78a2cc6f59e0e6dbfcc8 Mon Sep 17 00:00:00 2001 From: Aleksander Mistewicz Date: Fri, 22 Jul 2016 12:02:57 +0200 Subject: [PATCH] Publish database content in WWW_PUBLISH file Change-Id: Ic8f05d856b5001eb4ffe83f76c9f6a30ae79da11 Signed-off-by: Aleksander Mistewicz --- tsp/common.sh | 1 + tsp/html_head | 18 ++++++++++++++++++ tsp/html_tail | 3 +++ tsp/jobs/publish.sh | 5 +++++ 4 files changed, 27 insertions(+) create mode 100644 tsp/html_head create mode 100644 tsp/html_tail 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 @@ + + + + + + + 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 @@ +
+ + 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" -- 2.7.4