forked from OpenSlides/openslides-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
78 lines (49 loc) · 1.84 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Development and testing inside docker container or without docker (only unit and integration tests)
paths = openslides_backend/ tests/ cli/
all: black autoflake isort flake8 mypy
black:
black $(paths) --exclude tests/integration/old
autoflake:
autoflake -r -i --remove-all-unused-imports --ignore-init-module-imports $(paths)
isort:
isort $(paths)
flake8:
flake8 $(paths)
mypy:
mypy $(paths)
test:
pytest
test-unit-integration:
pytest tests/unit tests/integration
generate-models:
PYTHONPATH=. python cli/generate_models.py
black openslides_backend/models/models.py
check-models:
PYTHONPATH=. python cli/generate_models.py check
run-debug:
OPENSLIDES_DEVELOPMENT=1 python -m openslides_backend
pip-check:
pip-check
coverage:
pytest --cov openslides_backend --cov-report html:openslides_backend/htmlcov
# Build and run production docker container (not usable inside the docker container)
build-prod:
docker build . --tag=openslides-backend
run-prod: | build-prod
docker run --interactive --tty \
--publish 9002:9002 --publish 9003:9003 --rm openslides-backend
# Build and run development docker container setup with docker compose (not usable inside docker container)
start-dev:
USER_ID=$$(id -u $${USER}) GROUP_ID=$$(id -g $${USER}) docker-compose -f dev/docker-compose.dev.yml up --build --detach
stop-dev:
docker-compose -f dev/docker-compose.dev.yml down --volumes
start-dev-interactive:
USER_ID=$$(id -u $${USER}) GROUP_ID=$$(id -g $${USER}) docker-compose -f dev/docker-compose.dev.yml up --build
run-dev-standalone: | start-dev
docker-compose -f dev/docker-compose.dev.yml exec backend bash
run-dev run-bash: | run-dev-standalone
run-tests:
dev/run-tests.sh
# Build standalone development container (not usable inside the docker container)
build-dev:
docker build --file=dev/Dockerfile-dev . --tag=openslides-backend-dev