-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
79 lines (64 loc) · 1.46 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
.PHONY : help
help : Makefile
@sed -n 's/^##//p' $<
# Defaults
PROJECT_NAME = seeker
SHELL := /bin/bash
# Command variables
COMPOSE = docker-compose
COMPOSE_CMD = exec app python manage.py
MANAGE_CMD = python manage.py
# Helper functions to display messagse
ECHO_GREEN = @echo "\033[33;32m $1\033[0m"
ECHO_BLUE = @echo "\033[33;34m $1\033[0m"
ECHO_RED = @echo "\033[33;31m $1\033[0m"
# The default server host local development
HOST ?= localhost:8000
## migrate Run migrations.
migrate:
$(call ECHO_GREEN, Running migrations... )
( \
$(COMPOSE) $(COMPOSE_CMD) migrate --no-input; \
)
## collectstatic Collect static assets.
collectstatic:
$(call ECHO_GREEN, Collect static assets... )
( \
$(COMPOSE) $(COMPOSE_CMD) collectstatic --no-input; \
)
## migrations Create new database migrations.
migrations:
$(call ECHO_GREEN, Create new database migrations... )
( \
$(COMPOSE) $(COMPOSE_CMD) makemigrations; \
)
## build Build Docker images.
build:
$(call ECHO_GREEN, Building new images... )
( \
$(COMPOSE) build; \
)
## down Shutdown Docker containers.
down:
$(call ECHO_GREEN, Tear down containers... )
( \
$(COMPOSE) down; \
)
## up Run Docker containers.
up:
$(call ECHO_GREEN, Launching starship... )
( \
$(COMPOSE) up; \
)
## test_backend Run PyTest.
test:
$(call ECHO_GREEN, Running pytest...)
( \
./utils/test.sh; \
)
## setup Project initial setup.
setup:
$(call ECHO_GREEN, Setting up project...)
( \
./utils/setup.sh; \
)