-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathMakefile
70 lines (54 loc) · 1.87 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
help:
@echo "help -- print this help"
@echo "bootstrap -- rarely used: only first time project is cloned, or when infrastructure dependencies change"
@echo "test -- run all the tests"
@echo "run -- normally used to run the service locally"
@echo "stop -- normally used to turn the services off"
@echo "clean -- rarely used: only when we want to stop and remove everything created by bootstrapping"
@echo "ps -- show status"
@echo "dockershell -- run bash inside docker"
@echo "shell_plus -- run django shell_plus inside docker"
@echo "load_members_testdata -- populate the DB with members"
@echo "load_providers_test_data -- populate the DB with providers"
RUN=docker-compose exec web
MANAGE=${RUN} ./manage.py
# rarely used: only first time project is cloned, or when infrastructure dependencies change
bootstrap:
docker-compose up -d
${RUN} pip install -r /code/config/requirements-dev.txt
# run all the tests; to avoid migrations everytime and run only some of them, do for example:
# make test ARGS="-k members.tests.ReportCompleteTests"
test:
docker-compose start
${MANAGE} test -v2 --noinput $(ARGS)
# normally used to run the service locally
run:
docker-compose start
${MANAGE} migrate
${MANAGE} runserver 0.0.0.0:8127
# normally used to turn the services off
stop:
docker-compose stop
# rarely used: only when we want to stop and remove everything created by bootstrapping
clean:
docker-compose stop
docker-compose down --rmi local
ps:
docker-compose ps
createsuperuser:
${MANAGE} createsuperuser
dockershell:
${RUN} /bin/bash
migrations:
${MANAGE} makemigrations
migrate:
${MANAGE} migrate
collectstatic:
${MANAGE} collectstatic
shell_plus:
${MANAGE} shell_plus
load_members_testdata:
${MANAGE} load_data_test 20
load_providers_test_data:
${MANAGE} load_providers_data 20
.PHONY: help start stop ps clean test dockershell shell_plus only_test pep8