-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
60 lines (46 loc) · 1.3 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
DOCKER_COMPOSE ?= docker compose
PYTHON ?= python
GUNICORN ?= gunicorn
CENTRIFUGO ?= centrifugo
# use Makefile.local for customization
-include Makefile.local
.PHONY: docker-build
docker-build:
$(DOCKER_COMPOSE) build
.PHONY: docker-run
docker-run:
$(DOCKER_COMPOSE) up
.PHONY: cent
cent:
$(CENTRIFUGO) --config=centrifugo/config.json
.PHONY: run
run:
cd app/ && $(GUNICORN) -c core/gunicorn.conf.py core.wsgi
.PHONY: migrate
migrate:
$(PYTHON) app/manage.py migrate
.PHONY: migrations
migrations:
$(PYTHON) app/manage.py makemigrations
.PHONY: superuser
superuser:
$(PYTHON) app/manage.py createsuperuser
.PHONY: fill-db
fill-db:
$(PYTHON) app/manage.py fill_db $(ratio)
.PHONY: warmup-cache
warmup-cache:
$(PYTHON) app/manage.py generate_top_users
$(PYTHON) app/manage.py generate_top_tags
.PHONY: clear-db
clear-db:
$(PYTHON) app/manage.py clear_db
.PHONY: clear-db-schema
clear-db-schema:
$(PYTHON) app/manage.py clear_db_schema
.PHONY: docker-migrate docker-migrations docker-superuser docker-fill-db docker-clear-db docker-clear-db-schema
docker-migrate docker-migrations docker-superuser docker-fill-db docker-clear-db docker-clear-db-schema: docker-%:
$(DOCKER_COMPOSE) run -e ratio=$(ratio) --service-ports --rm askme-service make $*
.PHONY: clear-docker
clear-docker:
$(DOCKER_COMPOSE) down -v