branches:
  only:
    - master

language: python

python:
  - 2.6
  - 2.7

env:
  - REQUIREMENTS=1.3.X           TESTS="mutant boolean datetime file numeric related text web" SETTINGS=test_project.settings
  - REQUIREMENTS=1.3.X-postgres  TESTS="mutant boolean datetime file numeric related text web" SETTINGS=travis.postgres_settings TEMPLATE=template0
  - REQUIREMENTS=stable          TESTS="mutant boolean datetime file numeric related text web" SETTINGS=test_project.settings
  - REQUIREMENTS=stable-postgres TESTS="mutant boolean datetime file numeric related text web" SETTINGS=travis.postgres_settings TEMPLATE=template0
  - REQUIREMENTS=trunk           TESTS="mutant boolean datetime file numeric related text web" SETTINGS=test_project.settings
  - REQUIREMENTS=trunk-postgres  TESTS="mutant boolean datetime file numeric related text web" SETTINGS=travis.postgres_settings TEMPLATE=template0
  - REQUIREMENTS=mongo           TESTS="mutant boolean datetime file numeric nonrel text web"  SETTINGS=mongodb_settings

postgres:
  adapter: postgresql
  database: mutant
  username: postgres

install:
  - python setup.py install
  - pip install -r requirements/$REQUIREMENTS.txt --use-mirrors -I

before_script:
  - "echo $REQUIREMENTS | grep 'postgres' && psql -c 'CREATE DATABASE mutant TEMPLATE $TEMPLATE;' -U postgres"

script:
  - cd tests
  - python manage.py test $TESTS --settings=$SETTINGS

branches:
  only:
    - master

language: python

python:
  - 2.6
  - 2.7

env:
  - REQUIREMENTS=1.3.X           TESTS="mutant boolean datetime file numeric related text web" SETTINGS=test_project.settings
  - REQUIREMENTS=1.3.X-postgres  TESTS="mutant boolean datetime file numeric related text web" SETTINGS=travis.postgres_settings TEMPLATE=template0
  - REQUIREMENTS=stable          TESTS="mutant boolean datetime file numeric related text web" SETTINGS=test_project.settings
  - REQUIREMENTS=stable-postgres TESTS="mutant boolean datetime file numeric related text web" SETTINGS=travis.postgres_settings TEMPLATE=template0
  - REQUIREMENTS=trunk           TESTS="mutant boolean datetime file numeric related text web" SETTINGS=test_project.settings
  - REQUIREMENTS=trunk-postgres  TESTS="mutant boolean datetime file numeric related text web" SETTINGS=travis.postgres_settings TEMPLATE=template0
  - REQUIREMENTS=mongo           TESTS="mutant boolean datetime file numeric nonrel text web"  SETTINGS=mongodb_settings

postgres:
  adapter: postgresql
  database: mutant
  username: postgres

install:
  - python setup.py install
  - pip install -r requirements/$REQUIREMENTS.txt --use-mirrors -I

before_script:
  - "if echo $REQUIREMENTS | grep 'postgres'; then psql -c 'CREATE DATABASE mutant TEMPLATE $TEMPLATE;' -U postgres; fi"

script:
  - cd tests
  - python manage.py test $TESTS --settings=$SETTINGS

Make sure before_script postgres database creation returns a 0 exit status
Make sure before_script postgres database creation returns a 0 exit status
