Skip to content

Instantly share code, notes, and snippets.

@monkut
Created June 18, 2018 17:55
Show Gist options
  • Save monkut/149562f2a6e38d021450dec012bce4b3 to your computer and use it in GitHub Desktop.
Save monkut/149562f2a6e38d021450dec012bce4b3 to your computer and use it in GitHub Desktop.
WIP - sample circleci django/postgres config
version: 2
jobs:
build:
working_directory: ~/baserepository/
docker:
- image: circleci/python:3.6.5
environment:
PIPENV_VENV_IN_PROJECT: true
- image: mdillon/postgis:9.6
environment:
POSTGRES_USER: circleci
POSTGRES_DB: circle_test
steps:
- checkout
- run: sudo chown -R circleci:circleci /usr/local/bin
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.6/site-packages
- restore_cache:
key: deps9-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
- run:
name: install dependencies
command: |
sudo pip install pipenv
pipenv install
- save_cache:
key: deps9-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
paths:
- ".venv"
- "/usr/local/bin"
- "/usr/local/lib/python3.6/site-packages"
- run:
name: prepare database
command: |
pipenv run "python manage.py makemigrations"
pipenv run "python manage.py migrate"
- run:
name: run tests
command: |
pipenv run "python manage.py test"
- store_test_results:
path: test-results
- store_artifacts:
path: test-results
destination: tr1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment