-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathjustfile
95 lines (73 loc) · 2.94 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
85
86
87
88
89
90
91
92
93
94
95
# 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 http://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..."
./bin/cp-dist-file.sh docker/config/env-dist .env
fi
SERVICES := "db redis-cache localstack statsd oidcprovider gcs-emulator"
# Create a slick.sh file
slick-sh:
./bin/cp-dist-file.sh docker/config/slick.sh-dist slick.sh
chmod 755 slick.sh
# Build docker images.
build *args='base web frontend fakesentry db redis-cache localstack statsd oidcprovider gcs-emulator': _env
docker compose --progress plain build {{args}}
# Set up services.
setup: _env
docker compose run --rm web bash ./bin/setup-services.sh
# Run webapp and services.
run *args='--attach web --attach frontend --attach fakesentry web frontend fakesentry': _env
docker compose up {{args}}
# Stop service containers.
stop *args: _env
docker compose stop {{args}}
# Remove service containers and networks.
down *args: _env
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': _env
docker compose run --rm --entrypoint= test {{args}}
# Stop and remove docker containers and artifacts.
clean: _env stop
docker compose rm -f
rm -fr .docker-build
rm -rf frontend/build/
git restore frontend/build/
# Lint code, or use --fix to reformat Python code and apply auto-fixes for lint.
lint *args: _env
docker compose run --rm --no-deps test bash ./bin/run_lint.sh {{args}}
docker compose run --rm frontend lint
# Run Python unit test suite.
test *args: _env
docker compose run --rm test bash ./bin/run_test.sh {{args}}
# Build docs.
docs: _env
docker compose run --rm --no-deps web bash make -C docs/ clean
docker compose run --rm --no-deps web bash make -C docs/ html
# Rebuild requirements.txt file after requirements.in changes.
rebuildreqs *args: _env
docker compose run --rm --no-deps web bash pip-compile --generate-hashes {{args}}
# Verify that the requirements file is built by the version of Python that runs in the container.
verify-reqs: _env
docker compose run --rm --no-deps web bash ./bin/run_verify_reqs.sh
# Check how far behind different server environments are from main tip.
service-status *args: _env
docker compose run --rm --no-deps web bash service-status {{args}}
# Open psql cli.
psql *args: _env
@echo "\e[0;32mNOTE: Use password 'postgres'.\e[0m\n"
docker compose run --rm db psql -h db -U postgres -d tecken
# Clear Redis cache.
clear-cache: _env
docker compose run --rm redis-cache redis-cli -h redis-cache FLUSHDB
# Redis cli.
redis-cache-cli: _env
docker compose run --rm redis-cache redis-cli -h redis-cache