# .travis.yml
# Configuration file for Travis-CI.org hosted testing

language: python

python:
  - "2.7"

branches:
  only:
    - master
    - release

services:
  - postgresql

before_install:
  - sudo apt-get install -qq libpq-dev

install:
  - pip install -r controller/requirements.txt
  - pip install -r controller/dev_requirements.txt coveralls

before_script:
  - "psql -c 'create database deis_testing;' -U postgres"
  - |
    cat > controller/deis/local_settings.py <<EOF
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.postgresql_psycopg2',
            'NAME': 'deis_testing',
            'USER': 'postgres',
            'PASSWORD': '',
            'HOST': '',
            'PORT': '',
        }
    }
    SECRET_KEY = 'TotallyFake-SECRET_KEY-ForTravisCI'
    EOF

script:
  - make -C controller flake8
  - make -C controller coverage
  - make -C docs

after_success:
  - cd controller && coveralls
