-
Notifications
You must be signed in to change notification settings - Fork 47
/
Makefile
73 lines (49 loc) · 1.78 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
SHELL := /bin/bash
# ifeq (,$(wildcard .envs/.production/.django))
# $(error no .envs/.production/.django file located.)
# endif
help:
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
migrations:
docker compose -f local.yml run --rm django python manage.py makemigrations
migrate:
docker compose -f local.yml run --rm django python manage.py migrate
superuser:
docker compose -f local.yml run --rm django python manage.py createsuperuser
build:
docker compose -f local.yml build
up:
docker compose -f local.yml up
down:
docker compose -f local.yml down
shell:
docker compose -f local.yml run --rm django python manage.py shell
collectstatic:
docker compose -f local.yml run --rm django python manage.py collectstatic
rebuild:
make down && git pull && make build && make up
gulp:
docker compose -f local.yml run --rm node gulp
setup:
git pull && make build && make migrations && make migrate && make up
#
# this is for the production environment
#
pro-migrations:
docker compose -f production.yml run --rm django python manage.py makemigrations
pro-migrate:
docker compose -f production.yml run --rm django python manage.py migrate
pro-superuser:
docker compose -f production.yml run --rm django python manage.py createsuperuser
pro-build:
docker compose -f production.yml build
pro-up:
docker compose -f production.yml up -d
pro-down:
docker compose -f production.yml down
pro-shell:
docker compose -f production.yml run --rm django python manage.py shell
pro-collectstatic:
docker compose -f production.yml run --rm django python manage.py collectstatic
pro-rebuild:
make pro-down && git pull && make pro-build && make pro-up