Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
containers:
build-env:
image: python:3.7
volumes:
- local: .
container: /src
options: cached
- local: .pip-cache
container: /src/.pip-cache
options: cached
- local: .pipenv-cache
container: /src/.pipenv-cache
working_directory: /src
environment:
PYTHONPATH: "/src"
PYTHONUSERBASE: "/src/.pip-cache"
PIPENV_VENV_IN_PROJECT: true
run_as_current_user:
enabled: true
home_directory: /home/container-user
db:
image: postgres
tasks:
dep:
description: Install dependencies via pipenv
group: Utility tasks
run:
container: build-env
command: sh -c 'pip install --user pipenv; python -m pipenv install'
integration_test_fail:
description: Run the failing integration test.
prerequisites:
- dep
dependencies:
- db
run:
container: build-env
command: python -m pipenv run pytest test_sql.py
integration_test_pass:
description: Run the passing integration test (and take a look what changed)
prerequisites:
- dep
dependencies:
- db
run:
container: build-env
environment:
DB_HOST: db
command: python -m pipenv run pytest test_sql.py
shell:
description: Start a shell in the development environment.
group: Utility tasks
prerequisites:
- dep
run:
container: build-env
command: /bin/sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment