Support _wgt branch prerelease 15/214915/2
authorHyokeun Jeon <hyokeun.jeon@samsung.com>
Fri, 27 Sep 2019 10:56:33 +0000 (19:56 +0900)
committerHyokeun Jeon <hyokeun.jeon@samsung.com>
Tue, 1 Oct 2019 07:40:11 +0000 (16:40 +0900)
Change-Id: I83bca392e3313a482747ae5779115ee0eb6cba87

abs/job_abs_build.py
job_submit.py
job_test_trigger_info_update.py

index 8cefc0c..fc8bdb3 100755 (executable)
@@ -844,13 +844,14 @@ def start_build(fields):
     print project_properties.get('sdk_profile')
     data['profile'] = project_properties.get('sdk_profile')
     # Set new branch and tag
+    branch_postfix = project_properties.get('app_type', 'tpk')
     if data.get('branch').endswith('_' + data.get('profile')):
-        data['new_branch'] = data.get('branch') + '_tpk'
+        data['new_branch'] = data.get('branch') + '_' + branch_postfix
     else:
-        data['new_branch'] = data.get('branch') + '_' + data.get('profile') + '_tpk'
+        data['new_branch'] = data.get('branch') + '_' + data.get('profile') + '_' + branch_postfix
     #TODO: SPIN will use only _tpk postfix. Do not use profile name.
     if data.get('gerrit_infra') == 'LOCAL':
-        data['new_branch'] = data.get('branch') + '_tpk'
+        data['new_branch'] = data.get('branch') + '_' + branch_postfix
 
     #TODO: If app source postfix, link to original branch
     if data.get('branch').endswith(os.getenv('ABS_SOURCE_BRANCH_PREFIX')):
index 9020bf9..99e12a5 100755 (executable)
@@ -494,15 +494,15 @@ def main(build_type, build, event, sr_count):
     tagger = mygit.get_tag(tag)
 
     # get project mappings from git-obs-mapping and git-ref-mapping
-    if git_branch.endswith('_tpk'): # ABS - mappings w/o _tpk postfix(only for profiles).
-        # Set default to the current branch
+    if git_branch.endswith('_tpk') or git_branch.endswith('_wgt'): # ABS - mappings w/o _tpk postfix(only for profiles).
+        abs_branch_postfix = git_branch[-4:]
         work_branch = git_branch
         if os.getenv('ABS_SUPPORTED_PROFILES', None):
             for sp in os.getenv('ABS_SUPPORTED_PROFILES').split(','):
-                work_branch = work_branch.replace('_%s_tpk' % sp.lower(), '')
-            work_branch = work_branch.replace('_tpk', '')
+                work_branch = work_branch.replace('_%s%s' % (sp.lower(), abs_branch_postfix), '')
+            work_branch = work_branch.replace(abs_branch_postfix, '')
         else:
-            work_branch = work_branch.replace('_tpk', '')
+            work_branch = work_branch.replace(abs_branch_postfix, '')
         print 'work_branch:%s' % work_branch
         obs_target_prjs = git_obs_map(event['project'], work_branch)
         if os.getenv("REF_USE_FOR_PRERELEASE","0") == "1":
@@ -541,8 +541,9 @@ def main(build_type, build, event, sr_count):
         obs_use_specname = item['OBS_use_specname']
 
         if build_type == 'prerelease':
-            if obs_stg_prj == 'abs' and git_branch.endswith('_tpk'):
-                print 'Create ABS prerelease project...'
+            if obs_stg_prj == 'abs':
+                if git_branch.endswith('_tpk') or git_branch.endswith('_wgt'):
+                    print 'Create ABS prerelease project...'
             elif obs_stg_prj != 'prerelease':
                 print "%s is not 'prerelease' project in git-obs-mapping.xml." \
                       "It has been switched to submitobs workflow." \
index 1ad23ec..22cec26 100644 (file)
@@ -131,10 +131,11 @@ def main():
     saved_info['linked_build_projects'] = manifest_list
 
     #TODO: tizen_{profile}_tpk branch hack
-    if branch.endswith('_tpk'):
+    if branch.endswith('_tpk') or branch.endswith('_wgt'):
+        abs_branch_postfix = branch[-4:]
         if os.getenv('ABS_SUPPORTED_PROFILES', None):
             for sp in os.getenv('ABS_SUPPORTED_PROFILES').split(','):
-                branch = branch.replace('_%s_tpk' % sp.lower(), '')
+                branch = branch.replace('_%s%s' % (sp.lower(), abs_branch_postfix), '')
         #branch = branch.split('_%s_tpk' % target_project.split(':')[-1].lower())[0]
     print 'We have [%s] [%s]' % (target_project, branch)