Move all workspaces' paths to tsp/common.sh 96/72596/13
authorAleksander Mistewicz <a.mistewicz@samsung.com>
Wed, 1 Jun 2016 17:00:16 +0000 (19:00 +0200)
committerAleksander Mistewicz <a.mistewicz@samsung.com>
Mon, 11 Jul 2016 08:29:46 +0000 (10:29 +0200)
Change-Id: I5539cd6852c9e051467e923bf8520ca49e1d4c42
Signed-off-by: Aleksander Mistewicz <a.mistewicz@samsung.com>
tsp/common.sh
tsp/jobs/common_prep_flash_conf.sh
tsp/jobs/img_test_common.sh
tsp/jobs/publish.sh
tsp/jobs/trigger_downloads.sh
tsp/jobs/watcher.sh
tsp/scripts/free_diskspace.sh

index c4b59c3..dec04c3 100755 (executable)
@@ -27,6 +27,12 @@ die() {
     exit ${2:-1}
 }
 
+WS="${HOME}/ws"
+WS_WATCHER="${WS}/watcher"
+WS_DOWNLOAD="${WS}/dwn"
+WS_TEST="${WS}/img_test"
+WS_TEST_REMOTE="${WS}/img_test_remote"
+
 alias tspoll="TS_SOCKET=/tmp/socket.tl-master-poll tsp"
 alias tsmaster="TS_SOCKET=/tmp/socket.tl-master tsp"
 alias tspwb="TS_SOCKET=/tmp/socket.tl-pwb tsp"
index fd8b663..b19f653 100755 (executable)
@@ -22,9 +22,9 @@ export TSP_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/.."
 
 test -n "$1" || die "Missing argument: build nr"
 
-WORKDIR="${HOME}/ws/img_test/$1"
-WORKDIR_REMOTE="${HOME}/ws/img_test_remote/$1"
-DWN_WORKDIR="${HOME}/ws/dwn/$1"
+WORKDIR="${WS_TEST}/$1"
+WORKDIR_REMOTE="${WS_TEST_REMOTE}/$1"
+DWN_WORKDIR="${WS_DOWNLOAD}/$1"
 case "$0" in
     *odroid*)
         BOOT_IMG="`ls ${DWN_WORKDIR}/tizen-common_*-boot-*.tar.gz`"
index 3f347a2..9777b11 100755 (executable)
@@ -22,9 +22,10 @@ export TSP_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/.."
 
 test -n "$1" || die "Missing argument: build nr"
 
-WORKDIR="${HOME}/ws/img_test/$1"
-WORKDIR_REMOTE="${HOME}/ws/img_test_remote/$1"
-DWN_WORKDIR="${HOME}/ws/dwn/$1"
+WORKDIR="${WS_TEST}/$1"
+WORKDIR_REMOTE="${WS_TEST_REMOTE}/$1"
+DWN_WORKDIR="${WS_DOWNLOAD}/$1"
+
 case "$0" in
     *odroid*)
         TARGET="odroid"
index 83c8190..5e016f0 100755 (executable)
@@ -22,8 +22,8 @@ export TSP_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/.."
 
 test -n "$1" || die "Missing argument: build nr"
 
-IMG_WORKDIR="${HOME}/ws/img_test/$1"
-DWN_WORKDIR="${HOME}/ws/dwn/$1"
+IMG_WORKDIR="${WS_TEST}/$1"
+DWN_WORKDIR="${WS_DOWNLOAD}/$1"
 WORKSPACE="/home/jenkins/pub"
 
 # Clean up workspace
index 66efc4b..32832ac 100755 (executable)
@@ -20,9 +20,8 @@ export TSP_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/.."
 
 . "${TSP_DIR}/common.sh"
 
-WS="${HOME}/ws/watcher"
-mkdir -p "${WS}"
-cd "${WS}"
+mkdir -p "${WS_WATCHER}"
+cd "${WS_WATCHER}"
 touch next_dwn
 i=$(cat next_dwn)
 test -n "$i" || i=1
@@ -36,8 +35,8 @@ do
     fi
     for target in "minnow" "odroid"
     do
-        mkdir -p "${HOME}/ws/dwn/$i"
-        cd "${HOME}/ws/dwn/$i"
+        mkdir -p "${WS_DOWNLOAD}/$i"
+        cd "${WS_DOWNLOAD}/$i"
         # Download image for $target
         nr=$(tsmaster -L "DOWNLOAD_IMAGE_${target}" python "${TSP_DIR}/scripts/download_image.py" --log=INFO "--${target}" "$url")
         nr=$(tsmaster -D "$nr" -L "IMAGE_TEST_${target}" \
@@ -45,4 +44,4 @@ do
         i=$((i+1))
     done
 done
-echo "$i" > "${WS}/next_dwn"
+echo "$i" > "${WS_WATCHER}/next_dwn"
index bef28e0..4c1e7ff 100755 (executable)
@@ -20,9 +20,8 @@ export TSP_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/.."
 
 . "${TSP_DIR}/common.sh"
 
-WS="${HOME}/ws/watcher"
-mkdir -p "${WS}"
-cd "${WS}"
+mkdir -p "${WS_WATCHER}"
+cd "${WS_WATCHER}"
 touch dispatched_urls
 nr=$(tspoll -L PRERELEASE_WATCHER sh -c "ROOT=\"http://download.tizen.org/prerelease/tizen/common/\" \
     ${TSP_DIR}/scripts/crawler.py")
index 1cee18d..5aa0a24 100755 (executable)
 
 # Assume that most of the space is taken up by downloaded images.
 # Delete ones that were modified at least 3 days ago.
-for i in $(find "${HOME}/ws/dwn" -type d -mtime +2)
+
+export TSP_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/.."
+
+. "${TSP_DIR}/common.sh"
+
+for i in $(find "${WS_DOWNLOAD}" -type d -mtime +2)
 do
     if grep -q "Snapshot" "$(ls $i/diff-*.report)"
     then