-
Notifications
You must be signed in to change notification settings - Fork 10
/
justfile
80 lines (63 loc) · 2.41 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
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
_default:
@just --list
_env:
#!/usr/bin/env sh
if [ ! -f .env ]; then
echo "Copying docker/config/.env.dist to .env..."
cp docker/config/.env.dist .env
fi
# Build docker images.
build *args='deploy-base fakesentry gcs-emulator statsd nginx': _env
docker compose --progress plain build {{args}}
# Set up services.
setup: _env
docker compose run --rm web shell ./bin/run_setup.sh
# Run the webapp and services.
run *args='--attach=web --attach=nginx --attach=fakesentry web nginx': _env
docker compose up {{args}}
# Stop service containers.
stop *args:
docker compose stop {{args}}
# Remove service containers and networks.
down *args:
docker compose down {{args}}
# Open a shell in the web image.
shell *args='/bin/bash': _env
docker compose run --rm --entrypoint= web {{args}}
# Open a shell in the test container.
test-shell *args='/bin/bash':
docker compose run --rm --entrypoint= test {{args}}
# Remove build, test, and Python artifacts.
clean:
# python related things
-rm -rf build/
-rm -rf dist/
-rm -rf .eggs/
find . -name '*.egg-info' -exec rm -rf {} +
find . -name '*.egg' -exec rm -f {} +
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '__pycache__' -exec rm -rf {} +
# docs files
-rm -rf docs/_build/
# Lint code, or use --fix to reformat and apply auto-fixes for lint.
lint *args:
docker compose run --rm --no-deps base shell ./bin/run_lint.sh {{args}}
# Run tests.
test *args:
docker compose run --rm test shell ./bin/run_tests.sh {{args}}
# Generate Sphinx HTML documentation.
docs:
docker compose run --rm --no-deps base shell ./bin/build_docs.sh
# Rebuild requirements.txt file after requirements.in changes.
rebuild-reqs *args:
docker compose run --rm --no-deps base shell pip-compile --generate-hashes --strip-extras {{args}}
# Verify that the requirements file is built by the version of Python that runs in the container.
verify-reqs:
docker compose run --rm --no-deps base shell ./bin/run_verify_reqs.sh
# Check how far behind different server environments are from main tip.
service-status *args:
docker compose run --rm --no-deps base shell service-status {{args}}