Skip to content

Commit

Permalink
Merge pull request getredash#3 in BDT/redash from oauth to master
Browse files Browse the repository at this point in the history
* commit '5bad35d409485f450831dcd57a315bd0c067d563':
  code refactoring
  forgot to change circleci username in the artifacts url
  change ci address to my own
  • Loading branch information
王礼鑫 committed Jun 28, 2018
2 parents 2fc0d02 + 5bad35d commit 7b890da
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bin/upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,16 @@ class Release(namedtuple('Release', ('version', 'download_url', 'filename', 'des


def get_latest_release_from_ci():
response = requests.get('https://circleci.com/api/v1.1/project/github/getredash/redash/latest/artifacts?branch=master')
response = requests.get('https://circleci.com/api/v1.1/project/github/harmy/redash/latest/artifacts?branch=master&circle-token=0d516e8e705fe3918008781b7596b4b7d8c243aa')

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

tarball_asset = filter(lambda asset: asset['url'].endswith('.tar.gz'), response.json())[0]
filename = urllib.unquote(tarball_asset['pretty_path'].split('/')[-1])
version = filename.replace('redash.', '').replace('.tar.gz', '')

tarball_asset['url'] += '?circle-token=0d516e8e705fe3918008781b7596b4b7d8c243aa'

release = Release(version, tarball_asset['url'], filename, '')

return release
Expand Down

0 comments on commit 7b890da

Please sign in to comment.