-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
38 lines (28 loc) · 957 Bytes
/
Makefile
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
DOCKER_COMPOSE = COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose -p bma -f docker/compose.yaml
DOCKER_RUN = ${DOCKER_COMPOSE} run -u `id -u`
MANAGE_EXEC = ${DOCKER_COMPOSE} exec app python /app/src/manage.py
MANAGE_RUN = ${DOCKER_RUN} app python /app/src/manage.py
PARALLEL=4
TEST_OPTIONS = --failfast --keepdb --parallel ${PARALLEL}
TEST_TO_RUN = .
init: copy_env_file migrate
run:
${DOCKER_COMPOSE} up
migrate:
${MANAGE_RUN} $@ ${ARGS}
makemigrations:
${MANAGE_RUN} $@ ${ARGS}
bootstrap_devsite:
${MANAGE_RUN} $@ ${ARGS}
shell:
${MANAGE_RUN} $@ ${ARGS}
manage:
${MANAGE_RUN} ${COMMAND}
test:
${DOCKER_RUN} app \
bash -c "cd /app/src/; python manage.py test $(TEST_OPTIONS) ${TEST_TO_RUN}"
build_docker_image:
${DOCKER_COMPOSE} build app
copy_env_file:
test -f src/bma/environment_settings.py || cp src/bma/environment_settings.py.dist src/bma/environment_settings.py
test -f docker/.env || cp docker/.env.dev docker/.env