summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Mistewicz <a.mistewicz@samsung.com>2016-07-22 12:02:57 +0200
committerAleksander Mistewicz <a.mistewicz@samsung.com>2016-11-08 16:08:38 +0100
commita58847642e9c4665d2cc78a2cc6f59e0e6dbfcc8 (patch)
tree29bbc8703b4fb8d672e54e319fd766fa7f0938bc
parentb6b4a2afc696a63ec008fc1a1a0ae93885040312 (diff)
downloadmajor-a58847642e9c4665d2cc78a2cc6f59e0e6dbfcc8.tar.gz
major-a58847642e9c4665d2cc78a2cc6f59e0e6dbfcc8.tar.bz2
major-a58847642e9c4665d2cc78a2cc6f59e0e6dbfcc8.zip
Publish database content in WWW_PUBLISH file
Change-Id: Ic8f05d856b5001eb4ffe83f76c9f6a30ae79da11 Signed-off-by: Aleksander Mistewicz <a.mistewicz@samsung.com>
-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"