Handle some deprecations
[redakcja.git] / Makefile
1 .PHONY: deploy test
2
3
4 UID := $(shell id -u)
5 GID := $(shell id -g)
6
7
8
9 deploy: src/redakcja/localsettings.py
10         pip install -r requirements/requirements.txt
11         src/manage.py migrate --noinput
12         src/manage.py collectstatic --noinput
13
14
15 TEST_COMPOSE := docker compose -f docker-compose.test.yml
16
17 .ONESHELL:
18 test:
19         mkdir -p htmlcov
20         UID=$(UID) GID=$(GID) $(TEST_COMPOSE) run --rm --build test sh -c '\
21           python -Wall -m coverage run --branch --source=. \
22             ./manage.py test --settings=redakcja.settings.test $(ARGS); s=$$?; \
23           coverage report --skip-covered; coverage html -d /app/htmlcov; exit $$s'; \
24         status=$$?; $(TEST_COMPOSE) down; exit $$status
25
26
27
28 .ONESHELL:
29 test_full:
30         mkdir -p htmlcov
31         UID=$(UID) GID=$(GID) $(TEST_COMPOSE) run --rm --build test sh -c '\
32           python -Wall -m coverage run --branch --source=. \
33             ./manage.py test --settings=redakcja.settings.test_full $(ARGS); s=$$?; \
34           coverage report --skip-covered; coverage html -d /app/htmlcov; exit $$s'; \
35         status=$$?; $(TEST_COMPOSE) down; exit $$status
36
37
38
39 shell:
40         UID=$(UID) GID=$(GID) docker compose exec web bash