mirror of https://github.com/axmolengine/axmol.git
Merge pull request #7045 from heliclei/commit-status-desc
[ci skip] Set github commit status context & description
This commit is contained in:
commit
85a9e85dfd
|
@ -79,7 +79,7 @@ def main():
|
|||
print 'pull request #' + str(pr_num) + ' is '+action+', no build triggered'
|
||||
return(0)
|
||||
|
||||
data = {"state":"pending", "target_url":target_url}
|
||||
data = {"state":"pending", "target_url":target_url, "context":"Jenkins CI", "description":"Wait available build machine..."}
|
||||
access_token = os.environ['GITHUB_ACCESS_TOKEN']
|
||||
Headers = {"Authorization":"token " + access_token}
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ def main():
|
|||
print 'skip build for pull request #' + str(pr_num)
|
||||
return(0)
|
||||
|
||||
data = {"state":"pending", "target_url":target_url}
|
||||
data = {"state":"pending", "target_url":target_url, "context":"Jenkins CI", "description":"Waiting available build machine..."}
|
||||
access_token = os.environ['GITHUB_ACCESS_TOKEN']
|
||||
Headers = {"Authorization":"token " + access_token}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ statuses_url = payload['statuses_url']
|
|||
J = Jenkins(os.environ['JENKINS_URL'])
|
||||
target_url = os.environ['BUILD_URL']
|
||||
build_number = int(os.environ['BUILD_NUMBER'])
|
||||
data = {"state":"pending", "target_url":target_url}
|
||||
data = {"state":"pending", "target_url":target_url, "context":"Jenkins CI", "description":"Build finished!"}
|
||||
access_token = os.environ['GITHUB_ACCESS_TOKEN']
|
||||
Headers = {"Authorization":"token " + access_token}
|
||||
|
||||
|
@ -26,9 +26,10 @@ result = J[os.environ['JOB_NAME']].get_build(build_number).get_status()
|
|||
|
||||
if(result == STATUS_SUCCESS):
|
||||
data['state'] = "success"
|
||||
data['description'] = "Build successfully!"
|
||||
else:
|
||||
data['state'] = "failure"
|
||||
|
||||
data['description'] = "Build failed!"
|
||||
http_proxy = ''
|
||||
if(os.environ.has_key('HTTP_PROXY')):
|
||||
http_proxy = os.environ['HTTP_PROXY']
|
||||
|
|
|
@ -104,7 +104,7 @@ def main():
|
|||
set_description(pr_desc, target_url)
|
||||
|
||||
|
||||
data = {"state":"pending", "target_url":target_url}
|
||||
data = {"state":"pending", "target_url":target_url, "context":"Jenkins CI", "description":"Build started..."}
|
||||
access_token = os.environ['GITHUB_ACCESS_TOKEN']
|
||||
Headers = {"Authorization":"token " + access_token}
|
||||
|
||||
|
|
Loading…
Reference in New Issue