Select Git revision
.travis.yml
.travis.yml 2.16 KiB
language: python
# Cache dependencies between builds
cache: pip
python:
- '3.6'
services:
- postgresql
- redis-server
install:
- pip install -r requirements.txt
# Supervisor < 4 does not support python 3 but Supervisor 4 is not
# released to PyPI yet. => Install from Github
- pip install git+https://github.com/Supervisor/supervisor.git
before_script:
# Start Celery using the supervisor config
- supervisord
# Create local PostgreSQL database
# NOTE: the database name (here 'oser_backend_db') must match the name
# in one of these DATABASE_URL setting:
# - the one set up in TravisCI environment variables
# - the one set up in settings/default.py
- psql -c 'create database oser_backend_db;' -U postgres
# Go to the project root directory
- cd oser_backend
# Apply database migrations
- python manage.py migrate
script:
# Run tests
- python manage.py test
before_deploy:
# Return the repository root
- cd .. && ls
deploy:
# Deploy to Heroku once the tests have passed
# See TravisCI docs: https://docs.travis-ci.com/user/deployment/heroku/
provider: heroku
app:
# direct each branch to the corresponding app
master: oser-backend
staging: oser-backend-staging
run:
# automatically run new migrations
- 'python oser_backend/manage.py migrate'
api_key:
# Encrypted API key obtained from the following command
# (requires TravisCI and Heroku CLI installed)
# $ travis encrypt $(heroku auth:token) --add deploy.api_key
secure: tk6Pfrftlma+m6TYwl3DODf4rrtoPbvL5C94rBWEyjE3ttyitFIMqWAhG/lVR83ZmCd+sGvm250fqKes2+ZINYW92csvu9vngG4018qzDJ0agA2wOsNkn+mMih96hk+uWpRHWZ90BDG/wWcWnquSzS2fNNmdJVS5lEH4lPQBrgN0dTlHROHnFn5eJK7BR/22EOfF2wmREdMohn7QDBalju+C5ywGKNVYJ9Lhychlp/LbemrHViIXheCO3dS0Lu+AsQaH0Gh+793tmHWqRJhY4EP0IKi6xguH9/b80hkgAH8zZYo8HOXCGBUJnTNWJsf5H4Dvcoeny0p6ak/oyudwO/ZEQB0bs5MeAa5yCunEb6nCnpmPy+spvVjK3ZSGLhfetYHn44tApzFNnqOJPnHSFHy0Tbi/RDFpH6998iUWx7MbXsjsxLnj1C/c53l5xg9YxbZKp8YBNlmwMKdBaEnZEiHyVBhJG05JVnacMUAajtOisObG2yKBjcgUxNuTRIFlSj8UKKlF+wnjrRQLGHK32ISkE+g4NAePtqU5W4hjKqpMvv9uNEopkGb9XNo+9PWN168s7trKWcLIaqNykAVS/0LUYomuV2tMdIcP7biYO84r1YRmFFblTIb19vFsQNagRRZ27gFnjozPufVmDF8tp3buEeEkRTDZZIcJfoGoJFM=