From 5b98fe19286af85991a2fc4f7cd6db9607c45e62 Mon Sep 17 00:00:00 2001 From: Aleksander Mistewicz Date: Tue, 10 May 2016 16:24:25 +0200 Subject: [PATCH] Download and test snapshots Change-Id: I319dad8aef8432502b7d4ff009ee4af3abf01290 Signed-off-by: Aleksander Mistewicz --- tsp/cronfile.example | 2 +- tsp/jobs/trigger_downloads.sh | 8 +++++++- tsp/jobs/{prerelease_watcher.sh => watcher.sh} | 7 +++++-- tsp/scripts/{prerelease_crawler.py => crawler.py} | 9 ++++++--- 4 files changed, 19 insertions(+), 7 deletions(-) rename tsp/jobs/{prerelease_watcher.sh => watcher.sh} (77%) rename tsp/scripts/{prerelease_crawler.py => crawler.py} (93%) diff --git a/tsp/cronfile.example b/tsp/cronfile.example index e0234f7..4ab7e99 100644 --- a/tsp/cronfile.example +++ b/tsp/cronfile.example @@ -1,2 +1,2 @@ -*/5 * * * * /opt/testlab-major/tsp/jobs/prerelease_watcher.sh +*/5 * * * * /opt/testlab-major/tsp/jobs/watcher.sh 0 2 * * * /opt/testlab-major/tsp/jobs/watch_diskspace.sh diff --git a/tsp/jobs/trigger_downloads.sh b/tsp/jobs/trigger_downloads.sh index 05f91c5..7af889a 100755 --- a/tsp/jobs/trigger_downloads.sh +++ b/tsp/jobs/trigger_downloads.sh @@ -20,7 +20,7 @@ export TSP_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/.." . "${TSP_DIR}/common.sh" -WS="${HOME}/ws/prerelease_watcher" +WS="${HOME}/ws/watcher" mkdir -p "${WS}" cd "${WS}" touch next_dwn @@ -28,6 +28,12 @@ i=$(cat next_dwn) test -n "$i" || i=1 for url in $(cat new_urls) do + echo "Processing: ${url}" + if [ $url = "*latest*" ] + then + echo "Skipping symlink url" + continue + fi for target in "minnow" "odroid" do mkdir -p "${HOME}/ws/dwn/$i" diff --git a/tsp/jobs/prerelease_watcher.sh b/tsp/jobs/watcher.sh similarity index 77% rename from tsp/jobs/prerelease_watcher.sh rename to tsp/jobs/watcher.sh index 9ad76bc..bef28e0 100755 --- a/tsp/jobs/prerelease_watcher.sh +++ b/tsp/jobs/watcher.sh @@ -20,10 +20,13 @@ export TSP_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/.." . "${TSP_DIR}/common.sh" -WS="${HOME}/ws/prerelease_watcher" +WS="${HOME}/ws/watcher" mkdir -p "${WS}" cd "${WS}" touch dispatched_urls nr=$(tspoll -L PRERELEASE_WATCHER sh -c "ROOT=\"http://download.tizen.org/prerelease/tizen/common/\" \ - ${TSP_DIR}/scripts/prerelease_crawler.py") + ${TSP_DIR}/scripts/crawler.py") +nr=$(tspoll -D $nr -L DOWNLOAD_TRIGGER sh -c "${TSP_DIR}/jobs/trigger_downloads.sh") +nr=$(tspoll -D $nr -L SNAPSHOT_WATCHER sh -c "ROOT=\"http://download.tizen.org/snapshots/tizen/common/\" \ + ${TSP_DIR}/scripts/crawler.py") tspoll -D $nr -L DOWNLOAD_TRIGGER sh -c "${TSP_DIR}/jobs/trigger_downloads.sh" diff --git a/tsp/scripts/prerelease_crawler.py b/tsp/scripts/crawler.py similarity index 93% rename from tsp/scripts/prerelease_crawler.py rename to tsp/scripts/crawler.py index 31125f5..c61510a 100755 --- a/tsp/scripts/prerelease_crawler.py +++ b/tsp/scripts/crawler.py @@ -60,9 +60,12 @@ def crawl(seeds): if '__main__' == __name__: snapshots = crawl(seeds) - new = set() - for snapshot in snapshots: - new |= crawl((snapshot,)) + if "snapshots" in root: + new = snapshots + else: + new = set() + for snapshot in snapshots: + new |= crawl((snapshot,)) if os.path.exists(dispatched_urls): with open(dispatched_urls, 'r') as f: -- 2.7.4