Skip to content

Commit

Permalink
Hardcoding geckodriver download URL to overcome GitHub API rate limit…
Browse files Browse the repository at this point in the history
…s. Geckodriver version should be defined as a travis env variable.
  • Loading branch information
barancev committed Feb 17, 2019
1 parent 91ea70d commit 31005d8
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions scripts/travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ if [[ ! -z $CHROME ]]; then
fi

if [[ ! -z $MARIONETTE ]]; then
export GITHUB_AUTH="anonymous"
if [[ ! -z $GITHUB_TOKEN ]]; then
export GITHUB_AUTH="token $GITHUB_TOKEN"
fi
export GECKODRIVER_DOWNLOAD=`curl -H "Authorization: $GITHUB_AUTH" -s 'https://api.github.com/repos/mozilla/geckodriver/releases/latest' | python -c "import sys, json; r = json.load(sys.stdin); print([a for a in r['assets'] if 'linux64' in a['name']][0]['browser_download_url']);"`
export GECKODRIVER_DOWNLOAD="https://github.com/mozilla/geckodriver/releases/download/$GECKODRIVER_VERSION/geckodriver-$GECKODRIVER_VERSION-linux64.tar.gz"
curl -L -o geckodriver.tar.gz $GECKODRIVER_DOWNLOAD
gunzip -c geckodriver.tar.gz | tar xopf -
chmod +x geckodriver && sudo mv geckodriver /usr/local/bin
Expand Down

0 comments on commit 31005d8

Please sign in to comment.