ABS: Change rootstrap search option
authorhyokeun <hyokeun.jeon@samsung.com>
Wed, 23 May 2018 05:51:17 +0000 (14:51 +0900)
committerYonghee Han <onstudy@samsung.com>
Thu, 31 Jan 2019 01:21:23 +0000 (10:21 +0900)
Change-Id: If8925e9463f03273193c1ea34fb1819140137f9b

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

index 1988cf0..e6519bd 100755 (executable)
@@ -783,13 +783,21 @@ 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')).split(',')[0]
+    vm_map = ast.literal_eval(os.getenv('ABS_PROJECT_VM_MAP')).get(data.get('obs_project')).split(',')
+    vm_image = vm_map[0]
+    vm_rootstrap_profiles = vm_map[1]
+    # Adjust rootstrap search profile keyword
+    rs_search_profile = data.get('profile')
+    if vm_rootstrap_profiles and len(vm_rootstrap_profiles.split('|')) == 1 \
+        and data.get('profile') not in vm_rootstrap_profiles.split('|'):
+        rs_search_profile = vm_rootstrap_profiles
+    print 'Set rootstrap search profile: %s' % rs_search_profile
     my_tizen_studio = TizenStudio(vm_image)
     for x in data:
         print '[%s] %s' % (x, data[x])
     sys.stdout.flush()
     ret = my_tizen_studio.build_app_source(package=data.get('package'), \
-                                           profile=data.get('profile'), \
+                                           profile=rs_search_profile, \
                                            gitpath=data.get('project'), \
                                            build_mode=os.getenv('BUILD_MODE'), \
                                            parallel_jobs=parallel_jobs, \
index 4e0d3b5..f4eb3e1 100755 (executable)
@@ -39,7 +39,7 @@ def list_all_packages(profile, gerrit_env):
         mapping_list = git_obs_map_full_list(obs_project=profile, staging_project='abs', \
                                              gitcache=os.path.join(os.getenv('WORKSPACE'), 'temp_git_cache'), \
                                              gerrit_hostname=gerrit_env.hostname, \
-                                             gerrit_username='spinrobot', \
+                                             gerrit_username=gerrit_env.username, \
                                              gerrit_sshport=gerrit_env.sshport)
         for item in mapping_list:
             print item
index 87e961a..25634c7 100644 (file)
@@ -125,7 +125,7 @@ class TizenStudio(object):
         rc_dir = os.path.join(self.builddir, os.path.basename(rc_git_path))
         if not clone_gitproject(rc_git_path, rc_dir, \
                                 gerrit_hostname=gerrit_env.hostname, \
-                                gerrit_username='spinrobot', \
+                                gerrit_username=gerrit_env.username, \
                                 gerrit_sshport=gerrit_env.sshport):
             print 'Error clone project %s' % rc_git_path 
         rc_git = Git(rc_dir)