sudo: false

notifications:
  email: false

language: python
cache: pip

services:
  - elasticsearch

addons:
  apt:
    packages:
    - yui-compressor

install:
  - pip install -U pip
  - bundle install --deployment --path ../gems --binstubs ../gem-bin
  # Now install the rest of the required Python packages:
  - CFLAGS="-O0" pip install -r requirements.txt
  - pip install python-coveralls
  - pip install scrutinizer-ocular
  - pip check
  # Create a basic general.yml file:
  - sed -r
    -e "s,(POMBOLA_DB_USER:) 'sayit',\\1 'postgres',"
    -e "s,(POMBOLA_DB_NAME:) '',\\1 'pombola',"
    -e "s,(DJANGO_SECRET_KEY:) '',\\1 'notatallsecret',"
    conf/general.yml-example > conf/general.yml

before_script:
  - createdb -U postgres pombola
  - psql -c 'CREATE EXTENSION postgis;' -U postgres -d pombola
  - ./manage.py migrate --noinput
  - ./manage.py collectstatic --noinput

script:
  - ./run-tests --coverage

after_success:
  - coveralls
  - ocular --data-file ".coverage"

sudo: false

notifications:
  email: false

language: python
cache: pip

services:
  - elasticsearch

addons:
  apt:
    packages:
    - yui-compressor

install:
  - pip install -U pip
  - bundle update json
  - bundle install --deployment --path ../gems --binstubs ../gem-bin
  # Now install the rest of the required Python packages:
  - CFLAGS="-O0" pip install -r requirements.txt
  - pip install python-coveralls
  - pip install scrutinizer-ocular
  - pip check
  # Create a basic general.yml file:
  - sed -r
    -e "s,(POMBOLA_DB_USER:) 'sayit',\\1 'postgres',"
    -e "s,(POMBOLA_DB_NAME:) '',\\1 'pombola',"
    -e "s,(DJANGO_SECRET_KEY:) '',\\1 'notatallsecret',"
    conf/general.yml-example > conf/general.yml

before_script:
  - createdb -U postgres pombola
  - psql -c 'CREATE EXTENSION postgis;' -U postgres -d pombola
  - ./manage.py migrate --noinput
  - ./manage.py collectstatic --noinput

script:
  - ./run-tests --coverage

after_success:
  - coveralls
  - ocular --data-file ".coverage"

Update the json gem on Travis before trying bundle install
Update the json gem on Travis before trying bundle install

Travis's default build environment is now using Ruby 2.4.1p111; version
1.8.1 of the json gem doesn't build with this more recent Ruby version.
Our servers are still using an older version of Ruby, however, so this
commit just upgrades the json gem for running the tests on Travis.

Two better solutions, but which we don't have time for right now would
be:

 * Use the new rbenv support on our servers to use a more recent version
   of Ruby that matches that on Travis.

 * Use libsass instead of the compass gem. This would involve replacing
   quite a few mixins defined in compass, however.

(The Ruby gems are only present so that we have a known working version
of compass, so a change in the version of the json gem doesn't worry me
*too* much in terms of reproducibility.)
