Ref build check change code. 63/133363/2
authorhyokeun <hyokeun.jeon@samsung.com>
Mon, 12 Jun 2017 02:24:13 +0000 (11:24 +0900)
committerhyokeun <hyokeun.jeon@samsung.com>
Mon, 12 Jun 2017 23:52:01 +0000 (08:52 +0900)
1. Change candidate packages.
2. Do not delete OBS project if it failed.
3. Set default for useforbuild flag.
4. Shorten the test trigger git commit message.

Change-Id: If7030a27b51a0f7a05abedcb552922f1a8c5489d

job_ref_precheck_project_obs.py
job_test_trigger_info_update.py

index a404d35..63508cd 100644 (file)
@@ -40,9 +40,9 @@ def main():
 
     ref_project = trigger_info(os.getenv('TRIGGER_INFO'))['target']
     target_project = 'home:devel:Build:%s' % ref_project
-    package_to_build = 'appcore-widget'
+    package_to_build = os.getenv('REF_BUILDCHECK_PKG_PROFILE')
     if ':Base:ref:' in ref_project:
-        package_to_build = 'unzip'
+        package_to_build = os.getenv('REF_BUILDCHECK_PKG_BASE')
 
     build = BuildService(os.getenv('OBS_API_URL'), \
                          os.getenv('OBS_API_USERNAME'), \
@@ -53,7 +53,7 @@ def main():
             build.delete_project(target_project)
             sleep(5)
         build.create_project(target_project, src=ref_project.split(':ref:')[0]) # from base
-        for flag in ("build", "publish", "debuginfo", "useforbuild"):
+        for flag in ("build", "publish"):
             build.disable_build_flag(target_project, repo = None, flag=flag, status="disable")
 
         build.create_copy_pac(ref_project, package_to_build, target_project, package_to_build)
@@ -117,10 +117,11 @@ def main():
         while True:
             sleep(30)
             build_result = precheck_result()
-            if build_result not in (0, -1):
+            if build_result not in (result_map['Pass'], result_map['Fail']):
                 continue
             break
-        build.delete_project(target_project)
+        if build_result == result_map['Pass']:
+            build.delete_project(target_project)
         return build_result
 
 if __name__ == '__main__':
index 44bfd57..9cb51fc 100644 (file)
@@ -81,7 +81,7 @@ def main():
         mf.write(saved_info)
     mygit.add_files(GIT_FILE_NAME, True)
     try:
-        mygit.commit_staged('%s' % project)
+        mygit.commit_staged('%s' % project.replace('home:prerelease:',''))
         mygit.push(repo = 'origin', src = branch)
     except Exception as err:
         print '\n** Commit or push to git error, %s\n' % err