mirror of https://github.com/axmolengine/axmol.git
[Jenkins][ci skip] Change 'payload' to 'tag'
This commit is contained in:
parent
55911e1e78
commit
41615fe56a
|
@ -48,25 +48,14 @@ def make_temp_dir():
|
||||||
os.system(cmd)
|
os.system(cmd)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
#get payload from os env
|
#get tag
|
||||||
payload_str = os.environ['payload']
|
tag = os.environ['tag']
|
||||||
payload_str = payload_str.decode('utf-8','ignore')
|
|
||||||
#parse to json obj
|
|
||||||
payload = json.loads(payload_str)
|
|
||||||
|
|
||||||
#get pull number
|
|
||||||
tag = payload['tag']
|
|
||||||
print 'tag:' + tag
|
print 'tag:' + tag
|
||||||
|
|
||||||
url = payload['html_url']
|
pr_desc = '<h3>' + tag + ' is release' + '</h3>'
|
||||||
print "url:" + url
|
|
||||||
pr_desc = '<h3><a href=' + url + '>' + tag + ' is release' + '</a></h3>'
|
|
||||||
|
|
||||||
#get statuses url
|
|
||||||
statuses_url = payload['statuses_url']
|
|
||||||
|
|
||||||
#get pr target branch
|
#get pr target branch
|
||||||
branch = payload['branch']
|
branch = 'develop'
|
||||||
|
|
||||||
#set parent build description
|
#set parent build description
|
||||||
jenkins_url = os.environ['JENKINS_URL']
|
jenkins_url = os.environ['JENKINS_URL']
|
||||||
|
@ -76,16 +65,6 @@ def main():
|
||||||
|
|
||||||
set_description(pr_desc, target_url)
|
set_description(pr_desc, target_url)
|
||||||
|
|
||||||
#set commit status to pending
|
|
||||||
data = {"state":"pending", "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()
|
|
||||||
|
|
||||||
#pull origin develop
|
#pull origin develop
|
||||||
os.system('git reset --hard')
|
os.system('git reset --hard')
|
||||||
os.system("git clean -xdf -f")
|
os.system("git clean -xdf -f")
|
||||||
|
|
|
@ -106,6 +106,10 @@ def main():
|
||||||
print 'job_trigger_url is: ', job_trigger_url
|
print 'job_trigger_url is: ', job_trigger_url
|
||||||
|
|
||||||
#send trigger and payload
|
#send trigger and payload
|
||||||
|
if('tag' in payload_forword):
|
||||||
|
post_data = {'tag':""}
|
||||||
|
post_data['tag'] = payload_forword['tag']
|
||||||
|
else:
|
||||||
post_data = {'payload':""}
|
post_data = {'payload':""}
|
||||||
post_data['payload']= json.dumps(payload_forword)
|
post_data['payload']= json.dumps(payload_forword)
|
||||||
requests.post(job_trigger_url, data=post_data)
|
requests.post(job_trigger_url, data=post_data)
|
||||||
|
|
Loading…
Reference in New Issue