-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakeDrone
61 lines (43 loc) · 1.73 KB
/
MakeDrone
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
# ENV defaults to local (so that requirements/local.txt are installed), but can be overridden
# (e.g. ENV=production make setup).
ENV ?= local
# PYTHON specifies the python binary to use when creating virtualenv
PYTHON ?= python3.5
# Editor can be defined globally but defaults to nano
EDITOR ?= nano
# Just copy the settings file, don't open in editor
EDIT_SETTINGS ?= no
# Get root dir and project dir
PROJECT_ROOT ?= $(PWD)
SITE_ROOT ?= $(PROJECT_ROOT)/no_design_slack_clone
BLACK ?= \033[0;30m
RED ?= \033[0;31m
GREEN ?= \033[0;32m
YELLOW ?= \033[0;33m
BLUE ?= \033[0;34m
PURPLE ?= \033[0;35m
CYAN ?= \033[0;36m
GRAY ?= \033[0;37m
COFF ?= \033[0m
venv:
@echo "$(CYAN)Creating $(PYTHON) virtual environment$(COFF)"
@cd $(PROJECT_ROOT) && virtualenv -p $(PYTHON) venv
settings: $(SITE_ROOT)/settings/local.py
$(SITE_ROOT)/settings/local.py:
@echo "$(CYAN)Creating Django settings file$(COFF)"
@cp $(SITE_ROOT)/settings/local.py.example $(SITE_ROOT)/settings/local.py
@cp $(SITE_ROOT)/settings/local_test.py.example $(SITE_ROOT)/settings/local_test.py
coverage:
@echo "$(CYAN)Running automatic code coverage check$(COFF)"
@cd $(SITE_ROOT) && . $(PROJECT_ROOT)/venv/bin/activate && coverage run -m py.test
@cd $(SITE_ROOT) && . $(PROJECT_ROOT)/venv/bin/activate && coverage html
@cd $(SITE_ROOT) && . $(PROJECT_ROOT)/venv/bin/activate && coverage report
test: clean
@echo "$(CYAN)Running automatic tests$(COFF)"
@cd $(SITE_ROOT) && . $(PROJECT_ROOT)/venv/bin/activate && py.test
clean:
@echo "$(CYAN)Cleaning pyc files$(COFF)"
@cd $(SITE_ROOT) && find . -name "*.pyc" -exec rm -rf {} \;
quality:
@echo "$(CYAN)Running code quality checks$(COFF)"
@cd $(SITE_ROOT) && . $(PROJECT_ROOT)/venv/bin/activate && prospector && npm run lint;