env:
  global:
    - GIT_COMMITTED_AT=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then git log -1 --pretty=format:%ct; else git log -1 --skip 1 --pretty=format:%ct; fi)
    - RAILS_ENV=test
addons:
  postgresql: "9.6"
  chrome: stable
  apt:
    packages:
      - chromium-chromedriver
services:
  - redis-server
sudo: false
language: ruby
cache: bundler
before_install: gem install bundler -v 2.0.2
before_script:
  - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
  - chmod +x ./cc-test-reporter
  - cp config/database-travis.yml config/database.yml
  - psql -c 'create database orbf2_test;' -U postgres
  - ln --symbolic /usr/lib/chromium-browser/chromedriver "${HOME}/bin/chromedriver"
script:
  - script/cibuild
  - if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi

env:
  global:
    - GIT_COMMITTED_AT=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then git log -1 --pretty=format:%ct; else git log -1 --skip 1 --pretty=format:%ct; fi)
    - RAILS_ENV=test
addons:
  postgresql: "9.6"
  chrome: stable
  apt:
    packages:
      - chromium-chromedriver
services:
  - redis-server
sudo: false
language: ruby
cache: bundler
before_install:
  - gem uninstall bundler
  - gem install bundler -v 2.0.2
before_script:
  - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
  - chmod +x ./cc-test-reporter
  - cp config/database-travis.yml config/database.yml
  - psql -c 'create database orbf2_test;' -U postgres
  - ln --symbolic /usr/lib/chromium-browser/chromedriver "${HOME}/bin/chromedriver"
script:
  - echo "O HAI"
  - script/cibuild
  - if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi

Fix Travis bundler issue, by uninstalling bundler
Fix Travis bundler issue, by uninstalling bundler

So while we already tackled this by explicitly specifying which
bundler version to use, see .travis.yml

      gem install bundler -v 2.0.2

In newer builds this no longer passed, because when travis called
bundler again it would take a more recent version of bundler and it
would complain:

      Bundler could not find compatible versions for gem "bundler":
        In Gemfile:
          bundler (~> 2.0.2)

        Current Bundler version:
          bundler (2.1.4)
      This Gemfile requires a different version of Bundler.
      Perhaps you need to update Bundler by running `gem install bundler`?

See: https://travis-ci.org/BLSQ/orbf-rules_engine/builds/634282879

So, this time we first uninstall bundler, and then install
bundler. This seems to appease the bundler gods and the builds start
building again.
