Use urllib2 because @nicatrontg failed to install requests.
This commit is contained in:
parent
44c8f40a6a
commit
cc7e4356b1
1 changed files with 6 additions and 5 deletions
|
|
@ -1,8 +1,9 @@
|
|||
import requests
|
||||
import urllib2
|
||||
import json
|
||||
import sys
|
||||
import os
|
||||
|
||||
req_url = 'https://api.github.com/repos/NyxStudios/TShock/releases'
|
||||
branch = os.environ["GIT_BRANCH"]
|
||||
tag_name = os.environ["bamboo_tag_name"]
|
||||
name = os.environ["bamboo_release_name"]
|
||||
|
|
@ -14,9 +15,9 @@ with open('/home/bamboo/scripts/token.py') as f:
|
|||
body = 'This is the newest release for TShock. Please see the release thread for more information @ http://tshock.co/xf'
|
||||
|
||||
data = {'tag_name':tag_name, 'target_commitish':branch, 'name':name, 'body':body, 'draft':False, 'prerelease':False}
|
||||
|
||||
headers = {'Content-Type': 'application/json', 'Authorization': 'token ' + token}
|
||||
|
||||
print json.dumps(data)
|
||||
req = requests.post('https://api.github.com/repos/NyxStudios/TShock/releases', data = json.dumps(data), headers = headers)
|
||||
|
||||
print req.text
|
||||
json_data = json.dumps(data)
|
||||
req = urllib2.Request(req_url, json_data, headers)
|
||||
urllib2.urlopen(req)
|
||||
Loading…
Add table
Add a link
Reference in a new issue