ABS: Change profile setup process 00/143200/1
authorhyokeun <hyokeun.jeon@samsung.com>
Wed, 9 Aug 2017 04:44:47 +0000 (13:44 +0900)
committerhyokeun <hyokeun.jeon@samsung.com>
Wed, 9 Aug 2017 04:44:47 +0000 (13:44 +0900)
Profiles from configuration rather than git path or project name.

Change-Id: I80aa83dc6c6e53b7beb56230d0facbdc483f4351

abs/job_abs_build.py
abs/job_abs_update.py
common/tizen_studio.py

index 2bf1551..a1d1f44 100644 (file)
@@ -662,7 +662,7 @@ def start_build(fields):
     #### Running QEMU to launch Tizen Studio ####
     print '[ TizenStudio START ] %s' % (str(datetime.now()))
     sys.stdout.flush()
-    vm_image = ast.literal_eval(os.getenv('ABS_PROJECT_VM_MAP')).get(data.get('obs_project'))
+    vm_image = ast.literal_eval(os.getenv('ABS_PROJECT_VM_MAP')).get(data.get('obs_project')).split(',')[0]
     my_tizen_studio = TizenStudio(vm_image)
     ret = my_tizen_studio.build_app_source(package=data.get('package'), \
                                            profile=data.get('profile'), \
index 1ec9fb7..fe006c9 100644 (file)
@@ -100,10 +100,11 @@ def main(new_rs, gerrit_name):
     index = 0
     for up in profiles_to_update:
         print 'trigger %s' % up
-        vm_image = ast.literal_eval(os.getenv('ABS_PROJECT_VM_MAP')).get(up)
+        ret_prop = ast.literal_eval(os.getenv('ABS_PROJECT_VM_MAP')).get(up)
+        vm_image = ret_prop.split(',')[0]
+        supported_profiles = ret_prop.split(',')[1].split('|')
         my_tizen_studio = TizenStudio(vm_image)
-        image_to_check = my_tizen_studio.update_rootstrap(new_rs, rs_version)
-
+        image_to_check = my_tizen_studio.update_rootstrap(new_rs, rs_version, profiles=supported_profiles)
         todo_list = list_all_packages(up, gerrit_env)
         for single_dict in todo_list:
             index += 1
index 7aed43a..7472613 100644 (file)
@@ -132,7 +132,7 @@ class TizenStudio(object):
         rc_git.checkout(rc_git_branch)
         return rc_git.path
 
-    def update_rootstrap(self, rootstrap_src_url, rootstrap_version):
+    def update_rootstrap(self, rootstrap_src_url, rootstrap_version, profiles=[]):
 
         temp_image = os.path.join(self.vm_root, '.tmp.%s.v-%s' \
                      % (os.path.basename(self.vm_image), rootstrap_version))
@@ -152,7 +152,7 @@ class TizenStudio(object):
                      '__SHARE_ROOT__', self.share_root).replace( \
                      '__TOOL_PATH__', os.path.join(self.share_root, os.path.basename(sdk_tool_path))).replace( \
                      '__WRAPPER_PATH__', os.path.join(self.share_root, os.path.basename(self.wrapper_path))).replace( \
-                     '__PROFILE__', rootstrap_version.split('_')[0].split('-')[-1]).replace( \
+                     '__PROFILE__', ' '.join(profiles)).replace( \
                      '__PACKAGE_SERVER__', os.getenv('ABS_SDK_PACKAGE_SERVER')).replace( \
                      '__ROOTSTRAP_URL__', rootstrap_src_url)
         print 'UPDATE_CMD:\n%s' % update_cmd