-
Notifications
You must be signed in to change notification settings - Fork 17
/
Justfile
84 lines (64 loc) · 1.79 KB
/
Justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
DC := 'docker compose'
@_default:
just --list --unsorted
# format the Justfile
@fmt:
just --fmt --unstable
# ------
# Docker
# ------
@_env:
touch .env
@_docker-build:
-[ -f .just-docker-build ] || just build
@_docker-pull:
-[ -f .just-docker-pull ] || just pull
# build docker images for dev
@build: _docker-pull
{{ DC }} build --pull web
touch .just-docker-build
# pull the latest production images from Docker Hub
@pull: _env
-GIT_COMMIT= {{ DC }} pull db redis web builder
touch .just-docker-pull
# 'docker compose' up the entire system for dev
@run: _docker-pull
{{ DC }} up web worker
# open a bash shell in a fresh container
@run-shell:
{{ DC }} run --rm web bash
# open a bash shell in the running app
@shell:
{{ DC }} exec web bash
# stop all docker containers
@stop:
{{ DC }} stop
# force stop containers
@kill:
{{ DC }} kill
# run tests against local files
@test: _docker-pull
{{ DC }} run --rm test
# run tests against files in docker image
@test-image: _docker-build
{{ DC }} run --rm test-image
# remove all build, test, coverage, and Python artifacts
clean:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '__pycache__' -exec rm -rf {} +
rm -f .coverage
rm -rf docs/_build/
rm -f .just-*
# -------------------
# Manage dependencies
# -------------------
# identify stale Python requirements that need upgrading
@check-requirements: _docker-pull
{{ DC }} run --rm test ./bin/check-pinned-requirements.py
# regenerate requirements *.txt files based on *.in files
@compile-requirements: _docker-pull
{{ DC }} run --rm compile-requirements
# install Python dependencies for local development
@install-local-python-deps:
pip install -r requirements/dev.txt