-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
80 lines (69 loc) · 1.57 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
# COMMANDS FOR UNIX
CREATE := touch
PYTHON := python3
COPY := cp
PIPENV := pipenv
EXPORT = export $(1)=$(2)
# MODIFY COMMANDS FOR WINDOWS
ifeq '$(findstring ;,$(PATH))' ';'
CREATE := copy NUL
PYTHON := python
COPY := copy
PIPENV := $(PYTHON) -m pipenv
EXPORT = set $(1)=$(2)
endif
# Install the project
.PHONY: install
install:
$(PYTHON) -m pip install --upgrade --user pipenv
cd deployment && \
$(CREATE) backend.env
cd backend/config/settings && \
$(COPY) .env.example .env
cd backend && \
mkdir "static/front" && \
$(call EXPORT,PIPENV_VENV_IN_PROJECT,1) && \
$(PIPENV) sync --dev && \
$(PIPENV) run migrate && \
$(call EXPORT,DJANGO_SUPERUSER_PASSWORD,admin) && \
$(PIPENV) run django createsuperuser --noinput --username admin --username admin --email [email protected] && \
$(PIPENV) run fakedata
cd frontend && \
npm ci
cd email-templates-generator && \
npm ci && \
npm run build
cd docs && \
npm ci
# Update after pull
.PHONY: update
update:
cd frontend && \
npm i
cd email-templates-generator && \
npm i && \
npm run build
cd backend && \
$(PIPENV) sync --dev && \
$(PIPENV) run migrate
# Run the tests
.PHONY: test
test:
cd backend && \
$(PIPENV) run lint && \
$(PIPENV) run test
cd frontend && \
npm run test
cd email-templates-generator && \
npm run test
# Run the backend and frontend
.PHONY: start
start:
cd frontend && npm run start &
cd backend && $(PIPENV) run start
# Test the quality of code
.PHONY: quality
quality:
flake8 --config setup.cfg ./backend
cd frontend && npm run types
cd frontend && npm run lint