-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
78 lines (54 loc) · 1.65 KB
/
Makefile
File metadata and controls
78 lines (54 loc) · 1.65 KB
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
76
77
78
all: css migrate
initialize: npm css migrate sethookdir loadplatforms
HTMLFILES := $(shell find games/templates -type f)
PYTHON_VERSION = 3.12
npm:
npm install
css: common/input.css
npx @tailwindcss/cli -i ./common/input.css -o ./games/static/base.css
makemigrations:
uv run python manage.py makemigrations
migrate: makemigrations
uv run python manage.py migrate
init:
uv install $(PYTHON_VERSION)
uv sync
npm install
$(MAKE) sethookdir
$(MAKE) loadplatforms
sethookdir:
git config core.hooksPath .githooks
chmod +x .githooks/*
dev:
@npx concurrently \
--names "Django,Tailwind" \
--prefix-colors "blue,green" \
"uv run python -Wa manage.py runserver" \
"npx @tailwindcss/cli -i ./common/input.css -o ./games/static/base.css --watch"
caddy:
caddy run --watch
dev-prod: migrate collectstatic
PROD=1 uv run python -m gunicorn --bind 0.0.0.0:8001 timetracker.asgi:application -k uvicorn.workers.UvicornWorker
dumpgames:
uv run python manage.py dumpdata --format yaml games --output tracker_fixture.yaml
loadplatforms:
uv run python manage.py loaddata platforms.yaml
loadall:
uv run python manage.py loaddata data.yaml
loadsample:
uv run python manage.py loaddata sample.yaml
createsuperuser:
uv run python manage.py createsuperuser
shell:
uv run python manage.py shell
collectstatic:
uv run python manage.py collectstatic --clear --no-input
uv.lock: pyproject.toml
uv sync
test: uv.lock
uv run pytest
date:
uv run python -c 'import datetime; from zoneinfo import ZoneInfo; print(datetime.datetime.isoformat(datetime.datetime.now(ZoneInfo("Europe/Prague")), timespec="minutes", sep=" "))'
cleanstatic:
rm -r static/*
clean: cleanstatic