diff --git a/tools/jenkins-scripts/job-comment-trigger.py b/tools/jenkins-scripts/job-comment-trigger.py index 9a26c61fc8..d796fc4ae1 100644 --- a/tools/jenkins-scripts/job-comment-trigger.py +++ b/tools/jenkins-scripts/job-comment-trigger.py @@ -8,6 +8,9 @@ import sys import traceback import urllib2 +http_proxy = 'http://127.0.0.1:8087' +proxyDict = {'http':http_proxy,'https':http_proxy} + def main(): #get payload from os env payload_str = os.environ['payload'] @@ -82,7 +85,7 @@ def main(): if searchCI: ciOper = searchCI.group() if('rebuild' in ciOper): - requests.post(statuses_url, data=json.dumps(data), headers=Headers) + requests.post(statuses_url, data=json.dumps(data), headers=Headers, proxies = proxyDict) except: traceback.print_exc() @@ -112,7 +115,7 @@ def main(): else: post_data = {'payload':""} post_data['payload']= json.dumps(payload_forword) - requests.post(job_trigger_url, data=post_data) + requests.post(job_trigger_url, data=post_data, proxies = proxyDict) return(0) diff --git a/tools/jenkins-scripts/job-trigger.py b/tools/jenkins-scripts/job-trigger.py index 8da34ab1dd..1eb54d4cbd 100755 --- a/tools/jenkins-scripts/job-trigger.py +++ b/tools/jenkins-scripts/job-trigger.py @@ -8,6 +8,9 @@ import sys import traceback from jenkinsapi.jenkins import Jenkins +http_proxy = 'http://127.0.0.1:8087' +proxyDict = {'http':http_proxy,'https':http_proxy} + def check_queue_build(action, pr_num, statuses_url): username = os.environ['JENKINS_ADMIN'] password = os.environ['JENKINS_ADMIN_PW'] @@ -26,7 +29,7 @@ def check_queue_build(action, pr_num, statuses_url): access_token = os.environ['GITHUB_ACCESS_TOKEN'] Headers = {"Authorization":"token " + access_token} try: - requests.post(statuses_url, data=json.dumps(data), headers=Headers) + requests.post(statuses_url, data=json.dumps(data), headers=Headers, proxies = proxyDict) except: traceback.print_exc() @@ -71,7 +74,7 @@ def main(): print 'pull request #' + str(pr_num) + ' is '+action+', no build triggered' return(0) - r = requests.get(pr['url']+"/commits") + r = requests.get(pr['url']+"/commits", proxies = proxyDict) commits = r.json() last_commit = commits[len(commits)-1] message = last_commit['commit']['message'] @@ -90,7 +93,7 @@ def main(): Headers = {"Authorization":"token " + access_token} try: - requests.post(statuses_url, data=json.dumps(data), headers=Headers) + requests.post(statuses_url, data=json.dumps(data), headers=Headers, proxies = proxyDict) except: traceback.print_exc() @@ -98,7 +101,7 @@ def main(): #send trigger and payload post_data = {'payload':""} post_data['payload']= json.dumps(payload_forword) - requests.post(job_trigger_url, data=post_data) + requests.post(job_trigger_url, data=post_data, proxies = proxyDict) return(0) diff --git a/tools/jenkins-scripts/post-build.py b/tools/jenkins-scripts/post-build.py index 1b59a2c599..cd5994dd7c 100644 --- a/tools/jenkins-scripts/post-build.py +++ b/tools/jenkins-scripts/post-build.py @@ -29,4 +29,6 @@ if(result == STATUS_SUCCESS): else: data['state'] = "failure" -requests.post(statuses_url, data=json.dumps(data), headers=Headers) +http_proxy = 'http://127.0.0.1:8087' +proxyDict = {'http':http_proxy,'https':http_proxy} +requests.post(statuses_url, data=json.dumps(data), headers=Headers, proxies = proxyDict) diff --git a/tools/jenkins-scripts/pull-request-builder.py b/tools/jenkins-scripts/pull-request-builder.py index 44a971750e..e68a425d2a 100755 --- a/tools/jenkins-scripts/pull-request-builder.py +++ b/tools/jenkins-scripts/pull-request-builder.py @@ -61,6 +61,8 @@ def check_current_3rd_libs(branch): current_file = current_files[i] copy(current_file, backup_file) +http_proxy = 'http://127.0.0.1:8087' +proxyDict = {'http':http_proxy,'https':http_proxy} def main(): #get payload from os env payload_str = os.environ['payload'] @@ -105,7 +107,7 @@ def main(): Headers = {"Authorization":"token " + access_token} try: - requests.post(statuses_url, data=json.dumps(data), headers=Headers) + requests.post(statuses_url, data=json.dumps(data), headers=Headers, proxies = proxyDict) except: traceback.print_exc()