travis_install.sh 533 Bytes
Newer Older
1 2 3
#!/bin/bash
set -ex

4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
function retry {
  local total_tries=$1
  local remaining_tries=$total_tries
  shift
  while [ $remaining_tries -gt 0 ]; do
    "$@" && break
    remaining_tries=$(($remaining_tries - 1))
    sleep 5
  done

  [ $remaining_tries -eq 0 ] && {
    echo "Command still failed after $total_tries tries: $@"
    return 1
  }
  return 0
}

21
if [ -n "$TRAVIS" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
Adam Barth's avatar
Adam Barth committed
22
  gem install coveralls-lcov
23
  gem install bundler
24
  retry 5 npm install -g firebase-tools@">=3.6.1 <3.7.0"
25
fi