[Jenkins][ci skip] Add error commit status for cancel build in queue

This commit is contained in:
lm 2014-05-13 18:16:51 +08:00
parent 7d7d0b8251
commit 5cd5a2339b
1 changed files with 8 additions and 0 deletions

View File

@ -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