2023-09-16 13:39:13 +00:00
|
|
|
DOCKER_COMPOSE = COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose
|
2021-12-13 19:44:09 +00:00
|
|
|
DOCKER_RUN = ${DOCKER_COMPOSE} run -u `id -u`
|
|
|
|
DOCKER_BUILD = DOCKER_BUILDKIT=1 docker build
|
|
|
|
DOCKER_CONTAINER_NAME = backend
|
|
|
|
MANAGE_EXEC = python /app/src/manage.py
|
|
|
|
MANAGE_COMMAND = ${DOCKER_RUN} ${DOCKER_CONTAINER_NAME} ${MANAGE_EXEC}
|
2018-06-23 19:08:56 +00:00
|
|
|
|
2022-11-21 19:51:09 +00:00
|
|
|
init: setup_venv pre_commit_install migrate
|
|
|
|
|
2021-02-27 20:07:48 +00:00
|
|
|
run:
|
2021-12-13 19:44:09 +00:00
|
|
|
${DOCKER_COMPOSE} up
|
2021-02-28 22:55:01 +00:00
|
|
|
|
2022-11-21 19:51:09 +00:00
|
|
|
setup_venv:
|
2023-01-12 16:31:34 +00:00
|
|
|
rm -rf venv
|
|
|
|
python3.11 -m venv venv;
|
2022-11-21 19:51:09 +00:00
|
|
|
venv/bin/python -m pip install wheel setuptools;
|
2023-09-16 13:39:13 +00:00
|
|
|
venv/bin/python -m pip install pre-commit boto3 pip-tools;
|
2022-11-21 19:51:09 +00:00
|
|
|
|
|
|
|
pre_commit_install:
|
|
|
|
venv/bin/pre-commit install
|
|
|
|
|
2023-01-11 20:55:58 +00:00
|
|
|
pre_commit_run_all:
|
|
|
|
venv/bin/pre-commit run --all-files
|
|
|
|
|
2021-02-27 20:07:48 +00:00
|
|
|
makemigrations:
|
2023-01-21 15:20:50 +00:00
|
|
|
${MANAGE_COMMAND} makemigrations ${ARGS}
|
2021-02-27 20:07:48 +00:00
|
|
|
|
|
|
|
migrate:
|
2023-01-21 15:20:50 +00:00
|
|
|
${MANAGE_COMMAND} migrate ${ARGS}
|
2021-02-27 20:07:48 +00:00
|
|
|
|
|
|
|
createsuperuser:
|
2021-12-13 19:44:09 +00:00
|
|
|
${MANAGE_COMMAND} createsuperuser
|
2021-02-27 20:07:48 +00:00
|
|
|
|
|
|
|
shell:
|
2021-12-13 19:44:09 +00:00
|
|
|
${MANAGE_COMMAND} shell
|
2021-02-27 20:07:48 +00:00
|
|
|
|
|
|
|
manage_command:
|
2023-01-21 15:20:50 +00:00
|
|
|
${MANAGE_COMMAND} ${ARGS}
|
2021-02-28 23:15:01 +00:00
|
|
|
|
|
|
|
add_dependency:
|
2021-12-13 19:44:09 +00:00
|
|
|
${DOCKER_RUN} ${DOCKER_CONTAINER_NAME} poetry add --lock ${DEPENDENCY}
|
2021-02-28 23:15:01 +00:00
|
|
|
|
|
|
|
add_dev_dependency:
|
2021-12-13 19:44:09 +00:00
|
|
|
${DOCKER_RUN} ${DOCKER_CONTAINER_NAME} poetry add -D --lock ${DEPENDENCY}
|
|
|
|
|
|
|
|
poetry_lock:
|
|
|
|
${DOCKER_RUN} ${DOCKER_CONTAINER_NAME} poetry lock --no-update
|
|
|
|
|
|
|
|
poetry_command:
|
|
|
|
${DOCKER_RUN} ${DOCKER_CONTAINER_NAME} poetry ${COMMAND}
|
|
|
|
|
2023-01-21 15:20:50 +00:00
|
|
|
build_dev_docker_image: compile_requirements
|
2021-12-13 19:44:09 +00:00
|
|
|
${DOCKER_COMPOSE} build ${DOCKER_CONTAINER_NAME}
|
2022-11-21 19:51:09 +00:00
|
|
|
|
|
|
|
compile_requirements:
|
|
|
|
./venv/bin/pip-compile --output-file requirements/base.txt requirements/base.in
|
|
|
|
./venv/bin/pip-compile --output-file requirements/test.txt requirements/test.in
|
|
|
|
./venv/bin/pip-compile --output-file requirements/dev.txt requirements/dev.in
|