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"

sudo: false

notifications:
  email: false

language: python
cache: pip

services:
  - elasticsearch

addons:
  postgresql: "9.6"
  apt:
    packages:
    - yui-compressor
    - postgresql-9.6-postgis-2.3

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"

Fix for "CREATE EXTENSION postgis" failing in the new build environment
Fix for "CREATE EXTENSION postgis" failing in the new build environment

As described here, this is currently failing on the new container-based
trusty builds:

   https://github.com/travis-ci/travis-ci/issues/6972

This workaround causes Travis builds to be a bit slower, since it's
having to install additional packages, but fixes the problem for the
moment.
