sudo: false
env:
  global:
  - DJANGO_DEBUG=True
  - DJANGO_SETTINGS_MODULE=memopol.settings
  - MEMOPOL_DB_NAME=memopol
  - MEMOPOL_DB_USER=memopol
  - MEMOPOL_DB_PASSWORD=memopol
  - MEMOPOL_DB_HOST=localhost
  - MEMOPOL_DB_PORT=5432
  - MEMOPOL_DB_ENGINE=django.db.backends.postgresql_psycopg2
language: python
python:
- '2.7'
services:
- postgresql
install:
- pip install -e .[testing]
before_script:
- bin/install_client_deps.sh
- psql -c "CREATE USER memopol WITH CREATEDB PASSWORD 'memopol';" -U postgres
- psql -c "CREATE DATABASE memopol WITH OWNER memopol;" -U postgres
script:
- flake8 . --exclude '*/migrations,docs,static' --ignore E128
- py.test memopol representatives_positions representatives_recommendations
- django-admin migrate
after_success:
- codecov
deploy:
- provider: openshift
  user: memopol@laquadrature.net
  password:
    secure: atDq1NEkHXOsV2gZKeXAIn+PvbL3jduz3WK1qIs7BSHyNbrZMT1OUmvoXXrM8+i5eqW3TNsvp23w0RuD06wxSjHkPl+ZCEXP1Ao98p85UZNCgixxiwZHEhL6Amz5vqueGhv+47VOIKNgNFb9NAtRrWyIdA9xDUiK2oWkMSDmHas=
  app: master
  domain: memopol
  deployment_branch: master
  on:
    repo: political-memory/political_memory
    branch: master
- provider: openshift
  user: memopol@laquadrature.net
  password:
    secure: atDq1NEkHXOsV2gZKeXAIn+PvbL3jduz3WK1qIs7BSHyNbrZMT1OUmvoXXrM8+i5eqW3TNsvp23w0RuD06wxSjHkPl+ZCEXP1Ao98p85UZNCgixxiwZHEhL6Amz5vqueGhv+47VOIKNgNFb9NAtRrWyIdA9xDUiK2oWkMSDmHas=
  app: v3
  domain: memopol
  deployment_branch: v3
  on:
    repo: political-memory/political_memory
    branch: v3
