diff options
author | Aleksander Mistewicz <a.mistewicz@samsung.com> | 2016-05-04 16:52:34 +0200 |
---|---|---|
committer | Pawel Wieczorek <p.wieczorek2@samsung.com> | 2016-06-13 13:06:46 +0200 |
commit | a26624fde26e2624f696892619f5a7268fe0f348 (patch) | |
tree | 2a2ba5d6a3e43570547e4faf4cf3205a0ea5b61d /tsp | |
parent | 9346d88bbefda2606ee513f2cee31e4859993277 (diff) | |
download | major-a26624fde26e2624f696892619f5a7268fe0f348.tar.gz major-a26624fde26e2624f696892619f5a7268fe0f348.tar.bz2 major-a26624fde26e2624f696892619f5a7268fe0f348.zip |
Add tsp/jobs/trigger_downloads.sh
Change-Id: Ib00404de0231d67f6dba4c1fb6b06014b3bca8c6
Signed-off-by: Aleksander Mistewicz <a.mistewicz@samsung.com>
Diffstat (limited to 'tsp')
-rwxr-xr-x | tsp/common.sh | 1 | ||||
-rwxr-xr-x | tsp/jobs/prerelease_watcher.sh | 5 | ||||
-rwxr-xr-x | tsp/jobs/trigger_downloads.sh | 40 |
3 files changed, 44 insertions, 2 deletions
diff --git a/tsp/common.sh b/tsp/common.sh index af13253..b93534c 100755 --- a/tsp/common.sh +++ b/tsp/common.sh @@ -28,3 +28,4 @@ die() { } alias tspoll="TS_SOCKET=/tmp/socket.tl-master-poll tsp" +alias tsmaster="TS_SOCKET=/tmp/socket.tl-master tsp" diff --git a/tsp/jobs/prerelease_watcher.sh b/tsp/jobs/prerelease_watcher.sh index c16e8ec..9ad76bc 100755 --- a/tsp/jobs/prerelease_watcher.sh +++ b/tsp/jobs/prerelease_watcher.sh @@ -24,5 +24,6 @@ WS="${HOME}/ws/prerelease_watcher" mkdir -p "${WS}" cd "${WS}" touch dispatched_urls -tspoll -L PRERELEASE_WATCHER sh -c "ROOT=\"http://download.tizen.org/prerelease/tizen/common/\" \ - ${TSP_DIR}/scripts/prerelease_crawler.py" +nr=$(tspoll -L PRERELEASE_WATCHER sh -c "ROOT=\"http://download.tizen.org/prerelease/tizen/common/\" \ + ${TSP_DIR}/scripts/prerelease_crawler.py") +tspoll -D $nr -L DOWNLOAD_TRIGGER sh -c "${TSP_DIR}/jobs/trigger_downloads.sh" diff --git a/tsp/jobs/trigger_downloads.sh b/tsp/jobs/trigger_downloads.sh new file mode 100755 index 0000000..e4ef4c5 --- /dev/null +++ b/tsp/jobs/trigger_downloads.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +# Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Author: Aleksander Mistewicz <a.mistewicz@samsung.com> + +export TSP_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/.." + +. "${TSP_DIR}/common.sh" + +WS="${HOME}/ws/prerelease_watcher" +mkdir -p "${WS}" +cd "${WS}" +touch next_dwn +i=$(cat next_dwn) +test -n "$i" || i=1 +for url in $(cat new_urls) +do + for target in "minnow" "odroid" + do + mkdir -p "${HOME}/ws/dwn/$i" + cd "${HOME}/ws/dwn/$i" + # Download image for $target + nr=$(tsmaster -L "DOWNLOAD_IMAGE_${target}" python "${TSP_DIR}/scripts/download_image.py" "--${target}" "$url") + i=$((i+1)) + done +done +echo "$i" > "${WS}/next_dwn" |