summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Mistewicz <a.mistewicz@samsung.com>2016-12-22 11:43:54 (GMT)
committerAleksander Mistewicz <a.mistewicz@samsung.com>2017-02-01 16:36:51 (GMT)
commit323b03184e9c4ee1235b11aec55843b803833d95 (patch)
treebb280c8f5df0a1e754e2c18b462e3bb1f0575b87
parent28b0fe4717589ac624cf852241a29d95da548eeb (diff)
downloadmajor-323b03184e9c4ee1235b11aec55843b803833d95.zip
major-323b03184e9c4ee1235b11aec55843b803833d95.tar.gz
major-323b03184e9c4ee1235b11aec55843b803833d95.tar.bz2
Add tsresults queuerefs/changes/56/108756/3
Do not urge tsresults UPDATE_DB job Remove WWW jobs before dispatching a new one Remove lockfile-progs dependency Change-Id: I9732ae2aa59844ed5b6aafe0cfc0105436755235 Signed-off-by: Aleksander Mistewicz <a.mistewicz@samsung.com>
-rwxr-xr-xtsp/common.sh6
-rwxr-xr-xtsp/jobs/publish.sh9
-rwxr-xr-xtsp/jobs/update_db.sh2
-rwxr-xr-xtsp/jobs/update_www.sh12
4 files changed, 13 insertions, 16 deletions
diff --git a/tsp/common.sh b/tsp/common.sh
index 94f12cc..9bfc210 100755
--- a/tsp/common.sh
+++ b/tsp/common.sh
@@ -47,14 +47,17 @@ UPDATE_WWW="/var/tmp/should_update_www"
TMP_POLL="/tmp/tl-master-poll"
TMP_MASTER="/tmp/tl-master"
TMP_PWB="/tmp/tl-pwb"
+TMP_PWB_RESULTS="/tmp/tl-pwb-results"
test -d "$TMP_POLL" || mkdir "$TMP_POLL"
test -d "$TMP_MASTER" || mkdir "$TMP_MASTER"
test -d "$TMP_PWB" || mkdir "$TMP_PWB"
+test -d "$TMP_PWB_RESULTS" || mkdir "$TMP_PWB_RESULTS"
alias tspoll="TMPDIR=$TMP_POLL TS_SLOTS=1 tsp"
alias tsmaster="TMPDIR=$TMP_MASTER TS_SLOTS=100 tsp"
alias tspwb="TMPDIR=$TMP_PWB TS_SLOTS=1 tsp"
+alias tsresults="TMPDIR=$TMP_PWB_RESULTS TS_SLOTS=1 tsp"
init_db() {
# Load schema
@@ -113,8 +116,7 @@ update_db() {
test -n "$TAG" || die "Missing argument: tag"
test -n "$BUILD_NR" || die "Missing argument: build_nr"
test -n "$TARGET" || die "Missing argument: target"
- nr="$(tspwb -L DB sh "${TSP_DIR}/jobs/update_db.sh" "$SR" "$TAG" "$BUILD_NR" "$TARGET")"
- tspwb -u "$nr"
+ tsresults -L DB sh "${TSP_DIR}/jobs/update_db.sh" "$SR" "$TAG" "$BUILD_NR" "$TARGET"
}
get_userspace_dir() {
diff --git a/tsp/jobs/publish.sh b/tsp/jobs/publish.sh
index 2df6631..9d5452c 100755
--- a/tsp/jobs/publish.sh
+++ b/tsp/jobs/publish.sh
@@ -153,4 +153,11 @@ echo "PROFILE: $PROFILE"
# Publish to database
update_db "$SR" "$AVOCADO_TAG" "$BUILD_NR" "$TARGET"
-tspwb -L WWW sh "${TSP_DIR}/jobs/update_www.sh"
+# Remove all queued WWW jobs
+for i in $(tsresults | grep "queued.*WWW" | grep -o "^[0-9]*")
+do
+ tsresults -r "$i"
+done
+
+# Dispatch a new one
+tsresults -L WWW sh "${TSP_DIR}/jobs/update_www.sh"
diff --git a/tsp/jobs/update_db.sh b/tsp/jobs/update_db.sh
index a87e834..ec9f679 100755
--- a/tsp/jobs/update_db.sh
+++ b/tsp/jobs/update_db.sh
@@ -30,9 +30,7 @@ test -n "$TAG" || die "Missing argument: tag"
test -n "$BUILD_NR" || die "Missing argument: build_nr"
test -n "$TARGET" || die "Missing argument: target"
-lockfile-create --use-pid "${DBPATH}"
sqlite3 "${DBPATH}" "insert into test values (NULL,'$SR', CURRENT_TIMESTAMP, $BUILD_NR,\
(select r.rid from result r where r.rname='$TAG'),\
(select d.did from device d where d.dname='$TARGET'));"
echo "$SR;$TAG;$BUILD_NR;$TARGET" >> "${UPDATE_WWW}"
-lockfile-remove "${DBPATH}"
diff --git a/tsp/jobs/update_www.sh b/tsp/jobs/update_www.sh
index 41676e1..06af2fb 100755
--- a/tsp/jobs/update_www.sh
+++ b/tsp/jobs/update_www.sh
@@ -20,14 +20,7 @@ export TSP_DIR="$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P)/.."
. "${TSP_DIR}/common.sh"
-# {{{ DBPATH
-lockfile-create --use-pid "${DBPATH}"
-
-test -f "${UPDATE_WWW}" || {
- # }}} DBPATH
- lockfile-remove "${DBPATH}"
- die "No need to update the webpage"
-}
+test -f "${UPDATE_WWW}" || die "No need to update the webpage" 0
# Publish to www
{
@@ -44,6 +37,3 @@ test -f "${UPDATE_WWW}" || {
} > "${WWW_3_PUBLISH}"
rm "${UPDATE_WWW}"
-
-# }}} DBPATH
-lockfile-remove "${DBPATH}"