-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
71 lines (54 loc) · 1.35 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
# Variables definitions
# -----------------------------------------------------------------------------
TIMEOUT ?= 60
# Determine the OS platform (Windows or Linux)
ifeq ($(OS),Windows_NT)
SHELL := cmd.exe
RM := del /Q
EXE := .exe
else
SHELL := /bin/bash
RM := rm -rf
EXE :=
endif
# Target section and Global definitions
# -----------------------------------------------------------------------------
.PHONY: all clean test install run deploy down
all: clean test install run deploy down
test:
python -m pytest tests -vv --show-capture=all
install: generate_dot_env
pip install --upgrade pip wheel
pip install -r requirements.txt
run:
PYTHONPATH=. python manage.py runserver 0.0.0.0:8000
run_uvicorn:
PYTHONPATH=. uvicorn config.asgi:application --reload --host 0.0.0.0 --port 8000
run_celery:
PYTHONPATH=. celery -A config worker --max-tasks-per-child 1 -l info
run_channels:
PYTHONPATH=. daphne config.asgi:application -b 0.0.0.0 -p 9000
run_docker: generate_dot_env
docker-compose build
docker-compose up
generate_dot_env:
@if [ ! -e .env ]; then \
cp sample.env .env; \
fi
make_migrations:
python manage.py makemigrations
migrate:
python manage.py migrate
clean:
$(RM) *.pyc
$(RM) -r __pycache__
$(RM) Thumbs.db
$(RM) *~
$(RM) .cache
$(RM) build
$(RM) dist
$(RM) *.egg-info
$(RM) htmlcov
$(RM) .tox/
$(RM) -r docs/_build
$(RM) .env