Skip to content

Commit

Permalink
Utility to get last redash release url
Browse files Browse the repository at this point in the history
  • Loading branch information
arikfr committed Apr 13, 2014
1 parent e335398 commit 0daf715
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions bin/latest_release.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env python
import sys
import requests

if __name__ == '__main__':
response = requests.get('https://api.github.com/repos/EverythingMe/redash/releases')

if response.status_code != 200:
exit("Failed getting releases (status code: %s)." % response.status_code)

sorted_releases = sorted(response.json(), key=lambda release: release['id'], reverse=True)

latest_release = sorted_releases[0]
asset_url = latest_release['assets'][0]['url']

if '--url-only' in sys.argv:
print asset_url
else:
print "Latest release: %s" % latest_release['tag_name']
print latest_release['body']

print "\nTarball URL: %s" % asset_url
print 'wget: wget --header="Accept: application/octet-stream" %s' % asset_url


0 comments on commit 0daf715

Please sign in to comment.