Commit c9d3f70b by Christine Lytwynec

Merge pull request #2077 from edx/clytwynec/update-github-post-status-script

update github_post_status.py for jenkins_worker role
parents 1047ebd0 d50a360f
...@@ -25,7 +25,7 @@ def parse_args(arg_list): ...@@ -25,7 +25,7 @@ def parse_args(arg_list):
Parse the list of arguments, returning a dict. Parse the list of arguments, returning a dict.
Prints an error message and exits if the arguments are invalid. Prints an error message and exits if the arguments are invalid.
""" """
if len(arg_list) != 7: if len(arg_list) != 8:
print USAGE.format(arg_list[0]) print USAGE.format(arg_list[0])
exit(1) exit(1)
...@@ -41,11 +41,12 @@ def parse_args(arg_list): ...@@ -41,11 +41,12 @@ def parse_args(arg_list):
'sha': arg_list[3], 'sha': arg_list[3],
'status': arg_list[4], 'status': arg_list[4],
'target_url': arg_list[5], 'target_url': arg_list[5],
'description': arg_list[6] 'description': arg_list[6],
'context': arg_list[7],
} }
def post_status(org, repo, sha, status, target_url, description): def post_status(org, repo, sha, status, target_url, description, context):
""" """
Post a new status to GitHub. Post a new status to GitHub.
See http://developer.github.com/v3/repos/statuses/ for details. See http://developer.github.com/v3/repos/statuses/ for details.
...@@ -59,7 +60,8 @@ def post_status(org, repo, sha, status, target_url, description): ...@@ -59,7 +60,8 @@ def post_status(org, repo, sha, status, target_url, description):
params = { params = {
'state': status, 'state': status,
'target_url': target_url, 'target_url': target_url,
'description': description 'description': description,
'context': context,
} }
response = requests.post(url, data=json.dumps(params)) response = requests.post(url, data=json.dumps(params))
...@@ -85,7 +87,8 @@ def main(): ...@@ -85,7 +87,8 @@ def main():
post_status( post_status(
arg_dict['org'], arg_dict['repo'], arg_dict['org'], arg_dict['repo'],
arg_dict['sha'], arg_dict['status'], arg_dict['sha'], arg_dict['status'],
arg_dict['target_url'], arg_dict['description'] arg_dict['target_url'], arg_dict['description'],
arg_dict['context'],
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment