From 936153366d4835e08333fa4064eedf82c0a954b5 Mon Sep 17 00:00:00 2001 From: Yonghee Han Date: Wed, 4 Apr 2018 21:53:54 +0900 Subject: [PATCH] Trigger next "RSYNC" for the download server 1) after update to internel download, must rsync to mirror download. 2) do not "git clone" for the not able to fecth package on request job. Change-Id: I54a40c60af88607c7ad98e3ed4832d6830d95c5b --- job_request.py | 1 + job_sync_snapdiff.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/job_request.py b/job_request.py index f0fd064..ce8aa1e 100755 --- a/job_request.py +++ b/job_request.py @@ -603,6 +603,7 @@ def main(): except Exception as err: print 'Not able to fetch package list from OBS %s' % err event_fields['packages'] = [] + return 0 for var in ['targetproject', 'sourceproject', 'comment', 'sender']: diff --git a/job_sync_snapdiff.py b/job_sync_snapdiff.py index 35384cf..7234c49 100755 --- a/job_sync_snapdiff.py +++ b/job_sync_snapdiff.py @@ -34,7 +34,7 @@ import snapdiff from common.buildtrigger import trigger_info from common.utils import sync - +from common.buildtrigger import trigger_next def search_last_build(build_url, release_name, released=False): """Search the lastest build in build_url. @@ -145,6 +145,7 @@ def main(): url_pub_base = content[0]['url_pub_base'] repo_path = content[0]['repo_path'] build_id = content[0]['buildid'] + project = content[0]['project'] # pylint: disable=W0612 # disable unused variable release_name, _release_id = re.search(r'(\S*)_(\d{8}\.\d*)', \ @@ -249,7 +250,12 @@ def main(): context['images'].pop(item['name']) # sync all - return sync_world('index.html', repo_name, repo_path, snap_diff_name, context) + output = sync_world('index.html', repo_name, repo_path, snap_diff_name, context) + # TRIGGER NEXT RSYNC-DOWNLOAD (MIRROR) + if os.getenv("RSYNC_DOWNLOAD_ENABLED", "0") != "0": + trigger_next('RSYNC_DOWNLOAD', {'repo_path': repo_path, + 'project': project}) + return output if __name__ == '__main__': sys.exit(main()) -- 2.7.4