mirror of https://github.com/axmolengine/axmol.git
disable comment job trigger for v2 branch
This commit is contained in:
parent
fdb03f150d
commit
68f86adab1
|
@ -7,7 +7,7 @@ import traceback
|
||||||
import urllib2
|
import urllib2
|
||||||
|
|
||||||
http_proxy = ''
|
http_proxy = ''
|
||||||
if(os.environ.has_key('HTTP_PROXY')):
|
if('HTTP_PROXY' in os.environ):
|
||||||
http_proxy = os.environ['HTTP_PROXY']
|
http_proxy = os.environ['HTTP_PROXY']
|
||||||
proxyDict = {'http': http_proxy, 'https': http_proxy}
|
proxyDict = {'http': http_proxy, 'https': http_proxy}
|
||||||
|
|
||||||
|
@ -75,11 +75,12 @@ def main():
|
||||||
#set commit status to pending
|
#set commit status to pending
|
||||||
target_url = os.environ['JOB_PULL_REQUEST_BUILD_URL']
|
target_url = os.environ['JOB_PULL_REQUEST_BUILD_URL']
|
||||||
|
|
||||||
if(action == 'closed' or action == 'assigned'):
|
if(action == 'closed' or action == 'assigned' or branch == 'v2'):
|
||||||
print 'pull request #' + str(pr_num) + ' is ' + action + ', no build triggered'
|
print 'pull request #' + str(pr_num) + ' is ' + action + ', no build triggered'
|
||||||
return(0)
|
return(0)
|
||||||
|
|
||||||
data = {"state":"pending", "target_url":target_url, "context":"Jenkins CI", "description":"Wait available build machine..."}
|
data = {"state": "pending", "target_url": target_url, "context": "Jenkins CI",
|
||||||
|
"description": "Wait available build machine..."}
|
||||||
access_token = os.environ['GITHUB_ACCESS_TOKEN']
|
access_token = os.environ['GITHUB_ACCESS_TOKEN']
|
||||||
Headers = {"Authorization": "token " + access_token}
|
Headers = {"Authorization": "token " + access_token}
|
||||||
|
|
||||||
|
@ -87,7 +88,8 @@ def main():
|
||||||
if searchCI:
|
if searchCI:
|
||||||
ciOper = searchCI.group()
|
ciOper = searchCI.group()
|
||||||
if('rebuild' in ciOper):
|
if('rebuild' in ciOper):
|
||||||
requests.post(statuses_url, data=json.dumps(data), headers=Headers, proxies = proxyDict)
|
requests.post(statuses_url, data=json.dumps(data),
|
||||||
|
headers=Headers, proxies=proxyDict)
|
||||||
except:
|
except:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue