sudo: false
language: python
python:
  - '2.7'
before_script:
  - flake8 news
  - mysql -e 'create database basket;'
  - python manage.py migrate --noinput
script: py.test --cov news
env:
  - SECRET_KEY=FOO DEBUG=False ALLOWED_HOSTS=* DATABASE_URL=mysql://root@localhost/basket SUPERTOKEN='foo'
install:
  - bin/peep.py install -r requirements/compiled.txt -r requirements/dev.txt
  - pip install coveralls
after_success:
  - coveralls
notifications:
  irc:
    channels:
      - irc.mozilla.org#basket
    on_success: change
    on_failure: always
    use_notice: true
deploy:
  - provider: script
    script: bin/deploy-travis.sh dev
    on:
      branch: master
      repo: mozilla/basket
  - provider: script
    script: bin/deploy-travis.sh stage
    on:
      branch: master
      repo: mozilla/basket
  - provider: script
    script: bin/deploy-travis.sh prod
    on:
      tag: true
      repo: mozilla/basket

sudo: false
language: python
python:
  - '2.7'
before_script:
  - flake8 news
  - mysql -e 'create database basket;'
  - python manage.py migrate --noinput
script: py.test --cov news
env:
  - SECRET_KEY=FOO DEBUG=False ALLOWED_HOSTS=* DATABASE_URL=mysql://root@localhost/basket SUPERTOKEN='foo'
install:
  - bin/peep.py install -r requirements/compiled.txt -r requirements/dev.txt
  - pip install coveralls
after_success:
  - coveralls
notifications:
  irc:
    channels:
      - irc.mozilla.org#basket
    on_success: change
    on_failure: always
    use_notice: true
deploy:
  - provider: script
    script: bin/deploy-travis.sh dev
    on:
      branch: master
      repo: mozilla/basket
  - provider: script
    script: bin/deploy-travis.sh stage
    on:
      branch: master
      repo: mozilla/basket
  - provider: script
    script: bin/deploy-travis.sh prod
    on:
      tags: true
      repo: mozilla/basket

Deploy prod only on tags.
Deploy prod only on tags.
