-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (33 loc) · 1.35 KB
/
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
39
40
41
42
43
44
45
46
47
CUR_DIR=$(shell pwd)
VERSION_ENV=$(shell grep ^VERSION= .env | cut -d "=" -f 2-)
VERSION = $(shell echo $${VERSION:-$(VERSION_ENV)})
COMPOSE_PROJECT_NAME_ENV=$(shell grep ^COMPOSE_PROJECT_NAME= .env | cut -d "=" -f 2-)
COMPOSE_PROJECT_NAME = $(shell echo $${COMPOSE_PROJECT_NAME:-$(COMPOSE_PROJECT_NAME_ENV)})
##
# Backend
##
build:
docker compose -f docker-compose.yml -f docker-compose.dev.yml build ${SERVICE}
up:
docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d
down:
docker compose -f docker-compose.yml -f docker-compose.dev.yml down
##
# Packages
##
poetry_install:
docker compose -f docker-compose.yml -f docker-compose.dev.yml run --no-deps backend poetry install
poetry_lock:
docker compose -f docker-compose.yml -f docker-compose.dev.yml run --no-deps backend poetry lock --no-update
poetry_add:
docker compose -f docker-compose.yml -f docker-compose.dev.yml run --no-deps backend poetry add ${PACKAGE}
##
# Tests
##
mypy:
docker run -e ENVIRONMENT=test -v ${CUR_DIR}/src:/app --rm ${COMPOSE_PROJECT_NAME}/fastapi:${VERSION}-dev make mypy
linter:
docker run -e ENVIRONMENT=test -v ${CUR_DIR}/src:/app --rm ${COMPOSE_PROJECT_NAME}/fastapi:${VERSION}-dev make ltest
pytest:
docker run -e PYTHONPATH=/app -e ENVIRONMENT=test -v ${CUR_DIR}/src:/app --rm ${COMPOSE_PROJECT_NAME}/fastapi:${VERSION}-dev make pytest
ltest: mypy linter