-
-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathMakefile
75 lines (59 loc) · 1.47 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
# 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:
PYTHONPATH=. python -m pytest tests -vv --show-capture=all
install:
@echo "Installing dependencies"
virtualenv -p python3.11 env/
source env/bin/activate
pip install --upgrade pip wheel uv
uv pip install -r pyproject.toml --extra dev
run:
PYTHONPATH=. python manage.py runserver 0.0.0.0:8000
run_gunicorn:
PYTHONPATH=. gunicorn -b 0.0.0.0:8000 config.wsgi:application
run_celery:
PYTHONPATH=. celery -A config worker --max-tasks-per-child 1 -l info
run_docker: generate_dot_env
docker-compose build
docker-compose up
generate_dot_env:
@echo "Creating .env file"
@cd src/
@if [ ! -e .env ]; then \
cp sample.env .env; \
fi
make_migrations:
PYTHONPATH=. python manage.py makemigrations
migrate:
PYTHONPATH=. python manage.py migrate
samples:
PYTHONPATH=. python manage.py samples
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