-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (42 loc) · 1.04 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
DC = docker compose
STORAGES_FILE = docker_compose\storages.yaml
EXEC = docker exec -it
DB_CONTAINER = example-db
LOGS = docker logs
ENV_FILE = --env-file .env
APP_FILE = docker_compose\app.yaml
APP_CONTAINER = main-app
MANAGE_PY = python manage.py
.PHONY: storages
storages:
${DC} -f ${STORAGES_FILE} ${ENV_FILE} up -d
.PHONY: storages-down
storages-down:
${DC} -f ${STORAGES_FILE} down
.PHONY: postgres
postgres:
${EXEC} ${DB_CONTAINER} psql
.PHONY: storages-logs
storages-logs:
${LOGS} ${DB_CONTAINER} -f
.PHONY: app
app:
${DC} -f ${APP_FILE} -f ${STORAGES_FILE} ${ENV_FILE} up -d
.PHONY: app-logs
app-logs:
${LOGS} ${APP_CONTAINER} -f
.PHONY: app-down
app-down:
${DC} -f ${APP_FILE} -f ${STORAGES_FILE} down
.PHONY: migrate
migrate:
${EXEC} ${APP_CONTAINER} ${MANAGE_PY} migrate
.PHONY: migrations
migrations:
${EXEC} ${APP_CONTAINER} ${MANAGE_PY} makemigrations
.PHONY: superuser
superuser:
${EXEC} ${APP_CONTAINER} ${MANAGE_PY} createsuperuser
.PHONY: collectstatic
collectstatic:
${EXEC} ${APP_CONTAINER} ${MANAGE_PY} collectstatic