Add latest-release funtion 32/221332/1
authorYonghee Han <onstudy@samsung.com>
Tue, 31 Dec 2019 06:54:49 +0000 (15:54 +0900)
committerYonghee Han <onstudy@samsung.com>
Tue, 31 Dec 2019 06:54:49 +0000 (15:54 +0900)
Force make a latest-release link to milestone release

Change-Id: I40707b5c4fa53eafaa1008dc16823ae6b7f7acfb

job_release_snapshot.py

index 49a87a9..ae1405e 100755 (executable)
@@ -43,6 +43,7 @@ def main():
     obs_project = os.getenv('obs_project')
     release_id = os.getenv('release_id')
     version = os.getenv('version')
+    latest_release = os.getenv('latest')
 
     # only supports the snapshot repo created by Jenkins
     backend = BackendDB(os.getenv('REDIS_HOST'),
@@ -107,6 +108,14 @@ def main():
             sleep(1)
         break
 
+    if latest_release and 'snapshots' in profile_info['SnapshotDir']:
+        base_path = profile_info['SnapshotDir'].split('snapshots')
+        path_latest_release = os.path.join(path_repo_base, base_path[0], latest_release)
+        if os.path.lexists(path_latest_release):
+            print(path_release_snapshot, "->", path_latest_release)
+            os.unlink(path_latest_release)
+            os.symlink(path_release_snapshot, path_latest_release)
+
     # update reference project information with release id
     if os.getenv("REF_MAP_UPDATE_ENABLED", "0") != "0" \
         and os.getenv("REF_MAPPING_PRJ") is not None \