language: python

addons:
  postgresql: "9.3"

install:
  - pip install flake8
  - npm config set spin=false
  - npm install -g bower
  - sudo apt-get update && sudo apt-get install -y python-numpy python-scipy python-psycopg2  postgresql-9.3-postgis-2.1

script:
  - virtualenv --system-site-packages nutsurv-venv
  - source nutsurv-venv/bin/activate
  - pip install -r requirements/production.txt
  - pip install -r requirements/development.txt
  - flake8 --exclude migrations --ignore E501,C901 ./nutsurv
  - '! grep -C3 "field=jsonfield.fields.JSONField(help_text" -- */*/migrations/* || echo -e "\nMigrations for jsonfield.fields.JSONField are discouraged\n"'
  - psql -f enable_postgis.sql -U postgres
  - psql -f make_nutsurv_dev.sql -U postgres
  - bower install
  - cd nutsurv
  - sed -iorig s/postgres/nutsurv_dev/ nutsurv/settings.py
  - echo 'POSTGIS_VERSION = (2, 1)' >> configuration.py
  - ln -s /usr/lib/python2.7/dist-packages/psycopg2 ~/virtualenv/python2.7/lib/python2.7/site-packages
  - ln -s /usr/lib/python2.7/dist-packages/scipy  ~/virtualenv/python2.7/lib/python2.7/site-packages
  - py.test ./*/tests/*.py

language: python

addons:
  postgresql: "9.4"

install:
  - pip install flake8
  - npm config set spin=false
  - npm install -g bower
  - sudo apt-get update && sudo apt-get install -y python-numpy python-scipy python-psycopg2  postgresql-9.3-postgis-2.1

script:
  - virtualenv --system-site-packages nutsurv-venv
  - source nutsurv-venv/bin/activate
  - pip install -r requirements/production.txt
  - pip install -r requirements/development.txt
  - flake8 --exclude migrations --ignore E501,C901 ./nutsurv
  - '! grep -C3 "field=jsonfield.fields.JSONField(help_text" -- */*/migrations/* || echo -e "\nMigrations for jsonfield.fields.JSONField are discouraged\n"'
  - psql -f enable_postgis.sql -U postgres
  - psql -f make_nutsurv_dev.sql -U postgres
  - bower install
  - cd nutsurv
  - sed -iorig s/postgres/nutsurv_dev/ nutsurv/settings.py
  - echo 'POSTGIS_VERSION = (2, 1)' >> configuration.py
  - ln -s /usr/lib/python2.7/dist-packages/psycopg2 ~/virtualenv/python2.7/lib/python2.7/site-packages
  - ln -s /usr/lib/python2.7/dist-packages/scipy  ~/virtualenv/python2.7/lib/python2.7/site-packages
  - py.test ./*/tests/*.py

Update Travis to use Postgres 9.4 for JSONB
Update Travis to use Postgres 9.4 for JSONB
