-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (44 loc) · 1.39 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
.PHONY: clean setup-frontend setup-backend setup clean-python-deps run-backend run-frontend migrate test-backend lint-backend isort isort-autofix db-setup db-cleanup db-seed
PYTHON_DIRS := backend/condobus/ backend/org/ backend/transport/
clean:
@find . -name "*.pyc" -delete
setup-frontend:
@npm i --prefix frontend
setup-backend:
@pip install -r backend/requirements-test.txt
setup: setup-backend setup-frontend
clean-python-deps:
@pip freeze | grep -v "^-e" | xargs pip uninstall -y
run-backend: clean
@backend/manage.py runserver 0.0.0.0:8000
run-frontend: clean
@npm start --prefix frontend
run:
@docker-compose up
stop:
@docker-compose down
docker-build:
@docker-compose build
migrate: clean
@backend/manage.py migrate
test-backend: clean
@backend/manage.py test
test-frontend: clean
@npm test --prefix frontend
test: test-backend test-frontend
lint-backend: clean
@flake8 ${PYTHON_DIRS}
isort: clean
@isort --recursive --check-only --diff ${PYTHON_DIRS}
isort-autofix: clean
@isort --recursive --atomic ${PYTHON_DIRS}
db-setup:
# Add you postgres user with the -U option in the end of the commands below
@psql -c "CREATE DATABASE condobus;" -d postgres
@psql -c "CREATE USER condobus WITH PASSWORD 'condobus' SUPERUSER;" -d condobus
@psql -c "CREATE EXTENSION postgis;" -d condobus
db-cleanup:
@dropdb condobus
@dropuser condobus
db-seed:
@backend/manage.py loaddata db.json