language: node_js
node_js:
- 8.9.4
cache:
  bundler: true
  yarn: true
  directories:
   - /home/travis/.rvm/
before_install:
  - rvm install 2.5.1
  - rvm use 2.5.1
install:
  - yarn install
before_script:
- sudo apt-get install curl -y
- mv node_modules/.bin/which node_modules/.bin/which.backup
- cp config/database.travis.yml config/database.yml
- bundle install --jobs=3 --retry=3
- bundle exec rake db:create db:migrate
script:
- export SECRET_TOKEN=e815982094c62436066bafc9151f2d33c4a351a776654cb7487476de260a4592
- export MQTT_HOST=example.com
- export OS_UPDATE_SERVER=http://example.com
- export FW_UPDATE_SERVER=http://example.com
- export DB=postgresql
- export COVERALLS_REPO_TOKEN=lEX6nkql7y2YFCcIXVq5ORvdvMtYzfZdG
- bundle exec rspec --fail-fast=3
- npm run typecheck
- npm run test-slow
- npm run coverage

language: node_js
node_js:
- 8.9.4
cache:
  bundler: true
  yarn: true
  directories:
   - /home/travis/.rvm/
before_install:
  - rvm install 2.5.1
  - rvm use 2.5.1
install:
  - yarn install
  - bundle install --jobs=3 --retry=3
before_script:
- sudo apt-get install curl -y
- mv node_modules/.bin/which node_modules/.bin/which.backup
- cp config/database.travis.yml config/database.yml
- bundle exec rake db:create db:migrate
script:
- export SECRET_TOKEN=e815982094c62436066bafc9151f2d33c4a351a776654cb7487476de260a4592
- export MQTT_HOST=example.com
- export OS_UPDATE_SERVER=http://example.com
- export FW_UPDATE_SERVER=http://example.com
- export DB=postgresql
- export COVERALLS_REPO_TOKEN=lEX6nkql7y2YFCcIXVq5ORvdvMtYzfZdG
- bundle exec rspec --fail-fast=3
- npm run typecheck
- npm run test-slow
- npm run coverage

Move the Travis bundle install to the install phase for consistency with yarn install
Move the Travis bundle install to the install phase for consistency with yarn install
