Add the public jira info.
authormao xiaojuan <xiaojuan.mao@samsung.com>
Tue, 10 Jul 2018 05:54:42 +0000 (13:54 +0800)
committerYonghee Han <onstudy@samsung.com>
Thu, 31 Jan 2019 01:21:23 +0000 (10:21 +0900)
Change-Id: I3ced34a78f29cc5b3c1d4f6399db103c63cdd1fa

pmb/job_tool_jira_receiver.py
pmb/job_tool_sender.py [changed mode: 0755->0644]

index b60c14f..dac5692 100644 (file)
@@ -65,8 +65,8 @@ class TOOLS_DB(BuildMonitorExtention):
 
 
                 if jira_key_id > 0: #update
-                    query = "UPDATE %s SET status = \"%s\" WHERE jira_key = " % (table, item['status']) + "%s" 
-                    query_data = (item['status'],)
+                    query = "UPDATE %s SET status = \"%s\" WHERE jira_key = " % (table, item['status']) + "%s"
+                    query_data = (item['jira_key'],)
                     do_query(query, query_data)
 
 
@@ -108,8 +108,8 @@ class TOOLS_DB(BuildMonitorExtention):
                 print "commit_id : ", commit_id
 
                 if commit_id > 0: #update
-                    query = "UPDATE %s SET test_status = \"%s\" WHERE commit_id = " % (table, item['commit_id']) + "%s" 
-                    query_data = (item['test_status'],)
+                    query = "UPDATE %s SET test_status = \"%s\" WHERE commit_id = " % (table, item['test_status']) + "%s"
+                    query_data = (item['commit_id'],)
                     do_query(query, query_data)
 
 
@@ -133,7 +133,6 @@ if __name__ == "__main__":
 
     f = open( 'file0', 'r')
     str1 = subprocess.check_output('pwd')
-    print str1
     RAW = unicode_to_str(json.loads(f.read()))
     f.close()
     print "RAW = %s" % RAW
old mode 100755 (executable)
new mode 100644 (file)
index 149fba8..f2cb461
@@ -22,7 +22,7 @@ class SendData(object):
         JENKINS_SESSION = requests.Session()
         JENKINS_SESSION.trust_env = False
         JENKINS['item'] = []
-       url = os.getenv(type + '_URL') 
+       url = os.getenv(type + '_URL')
         print '[INFO] JENKINS url : ', url, '\n'
         headers = { 'content-type'  : 'application/json', 'Accept-Charset' : 'UTF-8' }
         data_url = url + '/job/' + job_name + '/' + build_number + '/api/json?pretty=true'
@@ -238,12 +238,12 @@ if __name__ == "__main__":
         JIRA = {}
         JIRA['item'] = []
         SEND = {}
-        
+
         # get data in spin jira
         sender.get_jira_data(JIRA, SEND, 'SPIN_JIRA', os.getenv("SPIN_JIRA_USER"), os.getenv("SPIN_JIRA_PW"))
 
-        # get data in spin jira
-        #sender.get_jira_data(JIRA, SEND, 'PUBLIC_JIRA', os.getenv("PUBLIC_JIRA_USER"), os.getenv("PUBLIC_JIRA_PW"))
+        # get data in dev jira
+        sender.get_jira_data(JIRA, SEND, 'PUBLIC_JIRA', os.getenv("PUBLIC_JIRA_USER"), os.getenv("PUBLIC_JIRA_PW"))
 
     sender.send_data(CONFIG, SEND)