forked from cosmicpython/code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (27 loc) · 885 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
# check docker compose version
DOCKER_COMPOSE := $(shell command -v docker-compose)
ifeq ($(DOCKER_COMPOSE),)
DOCKER_COMPOSE := docker compose
endif
# optimisation for builds, docker compose >= 1.25
export COMPOSE_DOCKER_CLI_BUILD=1
export DOCKER_BUILDKIT=1
all: down build up test
build:
$(DOCKER_COMPOSE) build
up:
$(DOCKER_COMPOSE) up -d
down:
$(DOCKER_COMPOSE) down --remove-orphans
test: up
$(DOCKER_COMPOSE) run --rm --no-deps --entrypoint=pytest api -s /tests/unit /tests/integration /tests/e2e
unit-tests:
$(DOCKER_COMPOSE) run --rm --no-deps --entrypoint=pytest api /tests/unit
integration-tests: up
$(DOCKER_COMPOSE) run --rm --no-deps --entrypoint=pytest api /tests/integration
e2e-tests: up
$(DOCKER_COMPOSE) run --rm --no-deps --entrypoint=pytest api -s /tests/e2e
logs:
$(DOCKER_COMPOSE) logs api | tail -100
black:
black -l 86 $$(find * -name '*.py')