-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (43 loc) · 1.25 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
48
49
50
51
52
53
54
55
56
57
58
59
DOCKER_COMPOSE = docker compose
# Include file with environment variables if it exists
-include Makefile.env
# Default target when running `make`
all: docker-up
PROXY_RUN = $(DOCKER_COMPOSE) run --rm proxy
# Container management
# --------------------
.PHONY: config
config: .env config.yaml
# Create .env file to set the UID/GID for the docker containers to run as to the current user
.env:
echo "DOCKER_LOCAL_USER=$(shell id -u):$(shell id -g)" >> .env
# Create config file from config_dist_dev.yaml if it does not exist yet
config.yaml:
cp config_dist_dev.yaml config.yaml
.PHONY: docker-up
docker-up: docker-build
$(DOCKER_COMPOSE) up
.PHONY: docker-down
docker-down: config
$(DOCKER_COMPOSE) down --remove-orphans
.PHONY: docker-purge
docker-purge: config
$(DOCKER_COMPOSE) down --remove-orphans --volumes
.PHONY: docker-build
docker-build: config
$(DOCKER_COMPOSE) build proxy
# Start a shell (bash) in the quart docker container
.PHONY: docker-shell
docker-shell:
$(PROXY_RUN) bash
.PHONY: lint-fix
lint-fix:
ruff format ./app ./tests
ruff check --fix ./app
# mypy has no fix mode, we run it anyway to report (unfixable) errors
mypy ./app
.PHONY: lint-check
lint-check:
ruff format --check --diff ./app ./tests
ruff check ./app
mypy ./app