[BuildMonitor] bugfixes 79/96879/1
authorSungHun Hwang <sh0924.hwang@samsung.com>
Thu, 10 Nov 2016 11:55:35 +0000 (20:55 +0900)
committerSungHun Hwang <sh0924.hwang@samsung.com>
Thu, 10 Nov 2016 12:00:40 +0000 (21:00 +0900)
1. change the get bm_img_size routine
2. add build_project_id temporarily

Change-Id: I38cdf6685420dc5319c869f71fd4f721c28533d9
Signed-off-by: SungHun Hwang <sh0924.hwang@samsung.com>
job_buildmonitor.py
job_imager.py

index e2c4e41..16e988c 100644 (file)
@@ -175,6 +175,12 @@ def package_build_for_sr_detail_sr_stage(git_tag, bm_start_datetime,
         query = "SELECT id FROM info_project WHERE project_name = %s"
         query_data = (bm_src_project,)
         info_project_id = buildmonitor_db.get_value_from_query_data(query, query_data)
+        ###================== [16_1110][TEMP] build_project
+        print '[%s][HSH] TEMP!!\n' % (__file__)
+        query = "INSERT INTO build_project (info_project_id, status) VALUES(%s, %s)"
+        query_data = (info_project_id, 'C')
+        buildmonitor_db.do_query(query, query_data)
+        ###================== [16_1110][TEMP] build_project
         query = "SELECT id FROM build_project WHERE info_project_id = %s"
         query_data = (info_project_id,)
         pre_build_project_id = buildmonitor_db.get_value_from_query_data(query, query_data)
@@ -487,7 +493,7 @@ def update_fail_create_image_for_sr_stage(fields, bm_start_datetime):
         buildmonitor_db.do_query(query, query_data)
 
 def create_image_for_build_image(fields, bm_start_datetime,
-                                 bm_end_datetime, build_id):
+                                 bm_end_datetime, build_id, bm_img_size):
     print '[%s] enter create_image_for_build_image\n' % (__file__)
 
     bm_repository = fields['repo']
@@ -497,13 +503,6 @@ def create_image_for_build_image(fields, bm_start_datetime,
     #print '[%s] bm_repository(%s), bm_device_name(%s), bm_status(%s), bm_url(%s)\n' \
     #      % (__file__, bm_repository, bm_device_name, bm_status, bm_url)
 
-    bm_base_path = os.getenv('PATH_REPO_BASE')
-    bm_img_url = os.path.join(bm_base_path, fields['repo_path'], fields['images_path'])
-    bm_img_path = bm_img_url + '/' + build_id + '_' + bm_device_name + '.tar.gz'
-    bm_img_size = os.path.getsize(bm_img_path)
-    #print '[%s] bm_img_path(%s), bm_img_size(%s)\n' \
-    #      % (__file__, bm_img_path, bm_img_size)
-
     # get curr_build_snapshot_id
     query = "SELECT id FROM build_snapshot WHERE snapshot_name = %s"
     query_data = (build_id,)
index a0705bc..3b0ce83 100755 (executable)
@@ -335,13 +335,21 @@ def main():
         trigger_next("IMAGE-TESTING", fields)
 
         if buildmonitor_enabled:
+            bm_base_path = os.getenv('PATH_REPO_BASE')
+            bm_img_url = os.path.join(bm_base_path, fields['repo_path'], fields['images_path'])
+            bm_img_path = bm_img_url + '/' + build_id + '_' + bm_device_name + '.tar.gz'
+            bm_img_size = os.path.getsize(bm_img_path)
+            #print '[%s] bm_img_path(%s), bm_img_size(%s)\n' \
+            #      % (__file__, bm_img_path, bm_img_size)
+
             bm_end_datetime = datetime.datetime.now()
             bm_data = {"bm_stage": 'Image',
                        "status" : status,
                        "fields" : fields,
                        "bm_start_datetime" : str(bm_start_datetime),
                        "bm_end_datetime" : str(bm_end_datetime),
-                       "build_id": build_id
+                       "build_id" : build_id,
+                       "bm_img_size" : bm_img_size
                       }
             trigger_next("BUILD-MONITOR", bm_data)
     else: