From: Aleksander Mistewicz Date: Fri, 22 Jul 2016 10:02:57 +0000 (+0200) Subject: Publish database content in WWW_PUBLISH file X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a58847642e9c4665d2cc78a2cc6f59e0e6dbfcc8;p=tools%2Ftestlab%2Fmajor.git Publish database content in WWW_PUBLISH file Change-Id: Ic8f05d856b5001eb4ffe83f76c9f6a30ae79da11 Signed-off-by: Aleksander Mistewicz --- 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"