forked from waggle-sensor/waggle-auth-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (35 loc) · 1.5 KB
/
Makefile
File metadata and controls
48 lines (35 loc) · 1.5 KB
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
# Default environment is 'dev'. You can override it by passing `ENV=prod` when running `make`.
ENV ?= dev
# Default value for data file path, can be overridden by passing `DATA_FILE`
DATA_FILE ?= ../waggle-auth-app-fixtures/data.json
# Extract just the filename from the data file path
DATA_FILENAME := $(notdir $(DATA_FILE))
# Set the compose file based on the environment.
DOCKER_COMPOSE_FILE := ./env/$(ENV)/docker-compose.yaml
# If ENV is dev, use --force-recreate to see changes immediately.
ifeq ($(ENV),dev)
FORCE_RECREATE := --force-recreate
else
FORCE_RECREATE :=
endif
start:
@docker-compose -f $(DOCKER_COMPOSE_FILE) up --build $(FORCE_RECREATE) -d
stop:
@docker-compose -f $(DOCKER_COMPOSE_FILE) down --volumes --remove-orphans
migrate:
@docker-compose -f $(DOCKER_COMPOSE_FILE) exec django python manage.py migrate
collectstatic:
@docker-compose -f $(DOCKER_COMPOSE_FILE) exec django python manage.py collectstatic --no-input
createsuperuser:
@docker-compose -f $(DOCKER_COMPOSE_FILE) exec django python manage.py createsuperuser
loaddata:
@cp $(DATA_FILE) ./$(DATA_FILENAME)
@docker-compose -f $(DOCKER_COMPOSE_FILE) exec django python manage.py loaddata $(DATA_FILENAME)
@rm ./$(DATA_FILENAME)
test:
@docker-compose -f $(DOCKER_COMPOSE_FILE) exec django python manage.py test
@docker-compose -f $(DOCKER_COMPOSE_FILE) exec django python manage.py check --deploy
up:
@docker-compose -f $(DOCKER_COMPOSE_FILE) up --build $(FORCE_RECREATE)
logs:
@docker-compose -f $(DOCKER_COMPOSE_FILE) logs -f