-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
60 lines (47 loc) · 1006 Bytes
/
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
PROJECT_DIR=dockinator
VENV_DIR=venv
REQ_FILE=$(PROJECT_DIR)/requirements.txt
MANAGE=$(PROJECT_DIR)/manage.py
PYTHON=$(VENV_DIR)/bin/python
PIP=$(VENV_DIR)/bin/pip
CRON_SCRIPT=etc/cron.sh
.PHONY: venv
venv:
python3 -m venv $(VENV_DIR)
.PHONY: install
install: venv
$(PIP) install -r $(REQ_FILE)
.PHONY: migrate
migrate:
$(PYTHON) $(MANAGE) migrate
.PHONY: runserver
runserver:
$(PYTHON) $(MANAGE) runserver
.PHONY: createsuperuser
createsuperuser:
$(PYTHON) $(MANAGE) createsuperuser
.PHONY: shell
shell:
$(PYTHON) $(MANAGE) shell
.PHONY: collectstatic
collectstatic:
$(PYTHON) $(MANAGE) collectstatic --noinput
.PHONY: clean
clean:
find . -name "*.pyc" -exec rm -f {} \;
find . -name "__pycache__" -exec rm -rf {} \;
.PHONY: cmd
cmd:
$(PYTHON) $(MANAGE) $(COMMAND)
.PHONY: black
black:
$(VENV_DIR)/bin/black $(PROJECT_DIR)
.PHONY: ruff
ruff:
$(VENV_DIR)/bin/ruff $(PROJECT_DIR)
.PHONY: lint
lint:
ruff check
.PHONY: cron
cron:
$(PYTHON) $(MANAGE) manage_expired --kill-expired