2023-01-07 20:09:47 +00:00
|
|
|
.PHONY: createsuperuser shell cleanstatic
|
2023-01-02 23:13:26 +00:00
|
|
|
|
2023-01-02 19:03:31 +00:00
|
|
|
all: css migrate
|
|
|
|
|
2023-01-05 20:10:17 +00:00
|
|
|
initialize: npm css migrate sethookdir loadplatforms
|
2023-01-02 19:03:31 +00:00
|
|
|
|
2023-01-02 23:17:23 +00:00
|
|
|
HTMLFILES := $(shell find src/web/tracker/templates -type f)
|
2023-01-02 23:13:26 +00:00
|
|
|
|
2023-01-03 11:34:50 +00:00
|
|
|
npm:
|
|
|
|
npm install
|
|
|
|
|
2023-01-03 11:14:27 +00:00
|
|
|
css: src/input.css
|
|
|
|
npx tailwindcss -i ./src/input.css -o ./src/web/tracker/static/base.css
|
2023-01-02 19:03:31 +00:00
|
|
|
|
|
|
|
css-dev: css
|
2023-01-03 11:14:27 +00:00
|
|
|
npx tailwindcss -i ./src/input.css -o ./src/web/tracker/static/base.css --watch
|
2023-01-02 19:03:31 +00:00
|
|
|
|
|
|
|
makemigrations:
|
2023-01-05 16:12:57 +00:00
|
|
|
poetry run python src/web/manage.py makemigrations
|
2023-01-02 19:03:31 +00:00
|
|
|
|
|
|
|
migrate: makemigrations
|
2023-01-05 16:12:57 +00:00
|
|
|
poetry run python src/web/manage.py migrate
|
2023-01-02 19:03:31 +00:00
|
|
|
|
2023-01-05 20:10:17 +00:00
|
|
|
dev: migrate sethookdir
|
2023-01-05 20:56:57 +00:00
|
|
|
poetry run python src/web/manage.py runserver_plus
|
2023-01-02 19:03:31 +00:00
|
|
|
|
2023-01-07 20:09:47 +00:00
|
|
|
dev-prod: migrate collectstatic sethookdir
|
|
|
|
cd src/web/; poetry run python -m gunicorn --bind 0.0.0.0:8001 web.asgi:application -k uvicorn.workers.UvicornWorker
|
|
|
|
|
2023-01-02 19:03:31 +00:00
|
|
|
dumptracker:
|
2023-01-05 16:12:57 +00:00
|
|
|
poetry run python src/web/manage.py dumpdata --format yaml tracker --output tracker_fixture.yaml
|
2023-01-02 19:03:31 +00:00
|
|
|
|
|
|
|
loadplatforms:
|
2023-01-05 16:12:57 +00:00
|
|
|
poetry run python src/web/manage.py loaddata platforms.yaml
|
2023-01-02 19:03:31 +00:00
|
|
|
|
|
|
|
loadsample:
|
2023-01-05 16:12:57 +00:00
|
|
|
poetry run python src/web/manage.py loaddata sample.yaml
|
2023-01-02 23:13:26 +00:00
|
|
|
|
|
|
|
createsuperuser:
|
2023-01-05 16:12:57 +00:00
|
|
|
poetry run python src/web/manage.py createsuperuser
|
2023-01-03 21:04:22 +00:00
|
|
|
|
|
|
|
shell:
|
2023-01-05 16:12:57 +00:00
|
|
|
poetry run python src/web/manage.py shell
|
2023-01-05 11:19:56 +00:00
|
|
|
|
2023-01-07 20:09:47 +00:00
|
|
|
collectstatic:
|
|
|
|
poetry run python src/web/manage.py collectstatic
|
|
|
|
|
2023-01-05 14:18:57 +00:00
|
|
|
poetry.lock: pyproject.toml
|
2023-01-05 11:19:56 +00:00
|
|
|
poetry install
|
|
|
|
|
|
|
|
test: poetry.lock
|
2023-01-05 20:10:17 +00:00
|
|
|
poetry run pytest
|
|
|
|
|
|
|
|
sethookdir:
|
2023-01-05 22:30:43 +00:00
|
|
|
git config core.hooksPath .githooks
|
|
|
|
|
2023-01-07 20:09:47 +00:00
|
|
|
date:
|
|
|
|
python3 -c 'import datetime; from zoneinfo import ZoneInfo; print(datetime.datetime.isoformat(datetime.datetime.now(ZoneInfo("Europe/Prague")), timespec="minutes", sep=" "))'
|
|
|
|
|
|
|
|
cleanstatic:
|
|
|
|
rm -r src/web/static/*
|
|
|
|
|
|
|
|
clean: cleanstatic
|