flailing again - trying to upload from stdin
This commit is contained in:
parent
250ed2bd6a
commit
e69e0f0c54
1 changed files with 5 additions and 4 deletions
|
@ -130,15 +130,16 @@ def _curl_uploader(upload_uri, asset_to_upload, token):
|
|||
'-sS',
|
||||
'-X', 'POST',
|
||||
'-u', ':{}'.format(os.environ['GH_TOKEN']),
|
||||
'--header', 'Content-Type: application/json',
|
||||
'--data-binary', str('@{}'.format(asset_to_upload)),
|
||||
str(upload_uri)
|
||||
'--header', 'Content-Type: application/octet-stream',
|
||||
'--data-binary', '@-',
|
||||
upload_uri
|
||||
]
|
||||
#'-d', '{"some_key": "some_value"}',
|
||||
print 'Calling curl:'
|
||||
print cmd
|
||||
print
|
||||
p = subprocess.Popen(cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
|
||||
with open(asset_to_upload, 'rb') as fp:
|
||||
p = subprocess.Popen(cmd, stdin=fp, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
|
||||
stdout, stderr = p.communicate()
|
||||
print 'curl return code:', p.returncode
|
||||
if stderr:
|
||||
|
|
Loading…
Reference in a new issue