Skip to content

Instantly share code, notes, and snippets.

@paltman
Created October 17, 2017 21:58
Show Gist options
  • Save paltman/0312eaa7074f99c7f6b77884759b00be to your computer and use it in GitHub Desktop.
Save paltman/0312eaa7074f99c7f6b77884759b00be to your computer and use it in GitHub Desktop.
# .circleci/config.yml
version: 2
jobs:
test:
docker:
- image: circleci/python:3.6.2
environment:
PGUSER: root
PGHOST: 127.0.0.1
- image: circleci/postgres:9.6.2
environment:
POSTGRES_USER: root
POSTGRES_DB: <same name as in your settings.py default>
POSTGRES_PASSWORD: ""
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "requirements.txt" }}
- v1-dependencies-
- run:
name: install dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r requirements-dev.txt
- save_cache:
paths:
- ./venv
key: v1-dependencies-{{ checksum "requirements.txt" }}
- run:
name: lint code
command: |
. venv/bin/activate
flake8 <project package>
isort --recursive --check-only --diff <project package> -sp tox.ini
- run:
name: run tests
command: |
. venv/bin/activate
python manage.py makemigrations --check --dry-run
coverage run manage.py test
codecov --token=<your private project token>
- store_artifacts:
path: test-reports
destination: test-reports
deploy:
docker:
- image: buildpack-deps:trusty-scm
working_directory: ~/repo
steps:
- checkout
- deploy:
name: Eldarion Cloud
command: |
bin/ec/auth.sh
bin/ec/deploy.sh staging
bin/ec/slack-notify.sh staging
workflows:
version: 2
test-and-deploy:
jobs:
- test
- deploy:
requires:
- test
filters:
branches:
only: master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment