diff --git a/tools/jenkins-scripts/pull-request-builder.py b/tools/jenkins-scripts/pull-request-builder.py
index a64d6e0403..7402a2a425 100755
--- a/tools/jenkins-scripts/pull-request-builder.py
+++ b/tools/jenkins-scripts/pull-request-builder.py
@@ -13,6 +13,7 @@ import platform
import subprocess
import codecs
from shutil import copy
+import MySQLdb
#set Jenkins build description using submitDescription to mock browser behavior
#TODO: need to set parent build description
@@ -61,10 +62,25 @@ def check_current_3rd_libs(branch):
current_file = current_files[i]
copy(current_file, backup_file)
+def save_build_stats(pr_num, key, value):
+ db_host = os.environ['db_host']
+ db_user = os.environ['db_user']
+ db_pw = os.environ['db_pw']
+ db = MySQLdb.connect(db_host, db_user, db_pw, "jenkins" )
+ cursor = db.cursor()
+ sql = '''INSERT INTO PullRequestBuild (pr_number, %s)
+ VALUES(%d, %d) ON DUPLICATE KEY UPDATE pr_number=VALUES(pr_number),
+ %s=VALUES(%s)''' % (key, pr_num, value, key, key)
+ print sql
+ cursor.execute(sql)
+ db.commit()
+ db.close()
+
http_proxy = ''
if(os.environ.has_key('HTTP_PROXY')):
http_proxy = os.environ['HTTP_PROXY']
proxyDict = {'http':http_proxy,'https':http_proxy}
+
def main():
#get payload from os env
payload_str = os.environ['payload']
@@ -205,8 +221,9 @@ def main():
if(ret == 0):
_path = 'tests/cpp-empty-test/proj.android/libs/armeabi/libcpp_empty_test.so'
filesize = os.path.getsize(_path)
- pr_desc = pr_desc + '