Compare commits

..
Author SHA1 Message Date
jobevers 26f5d08567 non-version tags don't break the build 2017-02-22 14:54:09 -06:00
jobevers d1c308181b add debugging info to curl 2017-02-22 13:33:37 -06:00
2 changed files with 21 additions and 4 deletions

No files matched your search

+9 -2
View File
@@ -95,8 +95,15 @@ def upload_asset(release, asset_to_upload, token):
'--header', 'Content-Type:application/octet-stream',
'--data-binary', '@{}'.format(asset_to_upload), upload_uri
]
raw_output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
output = json.loads(raw_output)
p = subprocess.Popen(cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
stdout, stderr = p.communicate()
print 'curl return code:', p.returncode
if stderr:
print 'stderr output from curl:'
print stderr
output = json.loads(stdout)
print 'stdout from curl:'
print stdout
if 'errors' in output:
raise Exception(output)
else:
+12 -2
View File
@@ -16,16 +16,26 @@ def main():
version = args.version
else:
tag = subprocess.check_output(['git', 'describe']).strip()
version = get_version_from_tag(tag)
try:
version = get_version_from_tag(tag)
except InvalidVersionTag:
# this should be an error but its easier to handle here
# than in the calling scripts.
print 'Tag cannot be converted to a version, Exitting'
return
set_version(version)
class InvalidVersionTag(Exception):
pass
def get_version_from_tag(tag):
match = re.match('v([\d.]+)', tag)
if match:
return match.group(1)
else:
raise Exception('Failed to parse version from tag {}'.format(tag))
raise InvalidVersionTag('Failed to parse version from tag {}'.format(tag))
def set_version(version):