-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
118 lines (93 loc) · 2.26 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
########################
# CONSTANTS
########################
SHELL=/bin/bash
PROJECT_NAME=gateway
BIND_TO=0.0.0.0
RUNSERVER_PORT=8000
SETTINGS=gateway.settings
TEST_APP=apps.core
APPS=apps
flake8=flake8 --max-complexity=6 --exclude '*migrations*'
PYTHONPATH=$(CURDIR)
MANAGE = PYTHONPATH=$(PYTHONPATH) DJANGO_SETTINGS_MODULE=$(SETTINGS) django-admin.py
-include Makefile.def
########################
# END OF CONSTANTS
########################
########################
# TARGETS
########################
run:
@echo Starting $(PROJECT_NAME)...
$(MANAGE) runserver $(BIND_TO):$(RUNSERVER_PORT)
worker:
celery -B -A gateway worker -l INFO
shell:
@echo Starting shell...
$(MANAGE) shell
flake8:
$(flake8) gateway
test: flake8
TESTING=1 PYTHONWARNINGS=ignore $(MANAGE) test $(TEST_OPTIONS) $(TEST_APP)
pre-install:
sudo npm install -g less
$(MAKE) generate-keyczart
generate-keyczart:
keyczart create --location=fieldkeys --purpose=crypt
keyczart addkey --location=fieldkeys --status=primary --size=256
install:
npm install
pip install -r requirements.txt
post-install:
webpack -p
$(MAKE) migrate
$(MANAGE) loaddata initial_pages.json
webpack:
webpack --config webpack.config.js
webpack-watch:
webpack --config webpack.config.js --watch
collectstatic:
@echo Collecting static
$(MANAGE) collectstatic --noinput -i components -i less
@echo Done
clean:
@echo Cleaning up...
find . -name '*.pyc' -delete
@echo Done
manage:
ifndef CMD
@echo Please, spceify -e CMD=command argument to execute
else
$(MANAGE) $(CMD)
endif
only_migrate:
ifndef APP_NAME
@echo Please, specify -e APP_NAME=appname argument
else
@echo Starting of migration of $(APP_NAME)
$(MANAGE) migrate $(APP_NAME)
@echo Done
endif
migrate:
ifndef APP_NAME
@echo "You can also specify -e APP_NAME='app' to check if new migrations needed for some app"
$(MANAGE) migrate
else
@echo Starting of migration of $(APP_NAME)
$(MANAGE) schemamigration $(APP_NAME) --auto
$(MANAGE) migrate $(APP_NAME)
@echo Done
endif
init_migrate:
ifndef APP_NAME
@echo Please, specify -e APP_NAME=appname argument
else
@echo Starting init migration of $(APP_NAME)
$(MANAGE) schemamigration $(APP_NAME) --initial
$(MANAGE) migrate $(APP_NAME)
@echo Done
endif
########################
# END TARGETS
########################