From 5cd5a2339b9d535b8793cdde2017f0963eddb68b Mon Sep 17 00:00:00 2001 From: lm Date: Tue, 13 May 2014 18:16:51 +0800 Subject: [PATCH] [Jenkins][ci skip] Add error commit status for cancel build in queue --- tools/jenkins-scripts/job-trigger.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/jenkins-scripts/job-trigger.py b/tools/jenkins-scripts/job-trigger.py index 5e347b3f0d..8da34ab1dd 100755 --- a/tools/jenkins-scripts/job-trigger.py +++ b/tools/jenkins-scripts/job-trigger.py @@ -21,6 +21,14 @@ def check_queue_build(action, pr_num, statuses_url): if(q_pr_num == pr_num): if(action == 'closed') or (q_statuses_url != statuses_url): queues.delete_item(queue) + target_url = os.environ['JOB_PULL_REQUEST_BUILD_URL'] + data = {"state":"error", "target_url":target_url} + access_token = os.environ['GITHUB_ACCESS_TOKEN'] + Headers = {"Authorization":"token " + access_token} + try: + requests.post(statuses_url, data=json.dumps(data), headers=Headers) + except: + traceback.print_exc() def main(): #get payload from os env