-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
90 lines (64 loc) · 1.82 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
79
80
81
82
83
84
85
86
87
88
89
90
TARGET_ENV ?= dev
bootstrap: \
up \
migrate \
load-fixtures
up:
docker compose up -d --no-deps --remove-orphans
%-run: ## Start specific services.
docker-compose up -d $$(echo $* | tr + " ")
load-fixtures:
docker compose run --rm app bash -c "./manage.py loaddata backend/fixtures/users.json \
backend/fixtures/conversations.json \
backend/fixtures/messages.json"
restart:
docker-compose restart
stop:
docker-compose stop
%-stop: ## Stop specific services.
docker-compose stop $$(echo $* | tr + " ")
down:
docker-compose down -v
build:
docker-compose --profile $(TARGET_ENV) build
logs:
docker-compose logs -f
%-logs: ## View the logs of the specified service container.
docker-compose logs -f --tail=500 $*
mm:
docker-compose exec -it app bash -c "python ./manage.py makemigrations"
superuser:
docker-compose exec -it app bash -c "python ./manage.py createsuperuser --username=root [email protected]"
.PHONY: superuser
migrate:
docker compose run --rm app python manage.py migrate
app-shell:
docker compose run --rm app bash
web-shell:
docker compose run --rm web sh
db-shell:
docker-compose exec -it db sh
app-attach:
docker attach chat-app
app-logs:
docker logs --follow chat-app
db-console:
docker-compose exec -it db psql -U postgres postgres
app-test:
docker-compose run --rm app-test bash -c "poetry run pytest"
app-lint:
docker-compose run --rm app-test bash -c "poetry run ruff check"
web-test:
docker-compose run --rm web-test sh -c "npm run test -- --coverage"
web-lint:
docker-compose run --rm web-test sh -c "CI=true npm run lint"
quality: \
web-test \
app-test \
web-lint \
app-lint
ps:
for i in $$(docker container ls --format "{{.ID}}"); do \
docker inspect -f '{{.State.Pid}} {{.Name}}' $$i; \
done
docker volume inspect django-channels_pgdata