-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (49 loc) · 1.75 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
SHELL := /bin/bash # Use bash syntax
ARG := $(word 2, $(MAKECMDGOALS) )
clean:
@find . -name "*.pyc" -exec rm -rf {} \;
@find . -name "__pycache__" -delete
test:
python backend/manage.py test backend/ $(ARG) --parallel --keepdb
test_reset:
python backend/manage.py test backend/ $(ARG) --parallel
backend_format:
black backend
upgrade: ## update the *requirements.txt files with the latest packages satisfying *requirements.in
pip install -U -q pip-tools
pip-compile --upgrade -o dev-requirements.txt dev-requirements.in
pip-compile --upgrade -o requirements.txt requirements.in
# Make everything =>, not ==
sed 's/==/>=/g' requirements.txt > requirements.tmp
mv requirements.tmp requirements.txt
compile_install_requirements:
@echo 'Installing pip-tools...'
export PIP_REQUIRE_VIRTUALENV=true; \
pip install pip-tools
@echo 'Compiling requirements...'
pip-compile requirements.in > requirements.txt
pip-compile dev-requirements.in > dev-requirements.txt
@echo 'Installing requirements...'
pip install -r requirements.txt && pip install -r dev-requirements.txt
# Commands for Docker version
docker_setup:
docker volume create {{project_name}}_dbdata
docker-compose build --no-cache backend
docker-compose run frontend npm install
docker_test:
docker-compose run backend python manage.py test $(ARG) --parallel --keepdb
docker_test_reset:
docker-compose run backend python manage.py test $(ARG) --parallel
docker_up:
docker-compose up -d
docker_update_dependencies:
docker-compose down
docker-compose up -d --build
docker_down:
docker-compose down
docker_logs:
docker-compose logs -f $(ARG)
docker_makemigrations:
docker-compose run --rm backend python manage.py makemigrations
docker_migrate:
docker-compose run --rm backend python manage.py migrate