From 427588b06c919240fcd61f44f3336efbff98240b Mon Sep 17 00:00:00 2001 From: Hyokeun Jeon Date: Fri, 27 Sep 2019 19:56:33 +0900 Subject: [PATCH] Support _wgt branch prerelease Change-Id: I83bca392e3313a482747ae5779115ee0eb6cba87 --- abs/job_abs_build.py | 7 ++++--- job_submit.py | 15 ++++++++------- job_test_trigger_info_update.py | 5 +++-- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/abs/job_abs_build.py b/abs/job_abs_build.py index 8cefc0c..fc8bdb3 100755 --- a/abs/job_abs_build.py +++ b/abs/job_abs_build.py @@ -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')): diff --git a/job_submit.py b/job_submit.py index 9020bf9..99e12a5 100755 --- a/job_submit.py +++ b/job_submit.py @@ -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." \ diff --git a/job_test_trigger_info_update.py b/job_test_trigger_info_update.py index 1ad23ec..22cec26 100644 --- a/job_test_trigger_info_update.py +++ b/job_test_trigger_info_update.py @@ -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) -- 2.7.4