membersystem/Makefile

59 lines
1.6 KiB
Makefile
Raw Normal View History

2021-02-28 23:20:59 +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}
2022-11-21 19:51:09 +00:00
init: setup_venv pre_commit_install migrate
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:
python3.10 -m venv venv;
venv/bin/python -m pip install wheel setuptools;
venv/bin/python -m pip install docker-compose pre-commit boto3 pip-tools;
pre_commit_install:
venv/bin/pre-commit install
makemigrations:
2021-12-13 19:44:09 +00:00
${MANAGE_COMMAND} makemigrations ${EXTRA_ARGS}
migrate:
2021-12-13 19:44:09 +00:00
${MANAGE_COMMAND} migrate ${EXTRA_ARGS}
createsuperuser:
2021-12-13 19:44:09 +00:00
${MANAGE_COMMAND} createsuperuser
shell:
2021-12-13 19:44:09 +00:00
${MANAGE_COMMAND} shell
manage_command:
2021-12-13 19:44:09 +00:00
${MANAGE_COMMAND} ${COMMAND}
add_dependency:
2021-12-13 19:44:09 +00:00
${DOCKER_RUN} ${DOCKER_CONTAINER_NAME} poetry add --lock ${DEPENDENCY}
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}
2022-08-09 17:29:42 +00:00
build_docker_image:
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
compile_requirements_test: compile_requirements
./venv/bin/pip-compile --output-file requirements/test.txt requirements/test.in
compile_requirements_dev: compile_requirements_test
./venv/bin/pip-compile --output-file requirements/dev.txt requirements/dev.in