45 lines
998 B
Makefile
45 lines
998 B
Makefile
.PHONY: up down seed invoke install logs console clean graphs docs
|
|
|
|
PY ?= .venv/bin/python
|
|
PIP ?= .venv/bin/pip
|
|
DOT_SRC := $(wildcard docs/graphs/*.dot)
|
|
SVG_OUT := $(DOT_SRC:.dot=.svg)
|
|
|
|
install:
|
|
python3 -m venv .venv
|
|
$(PIP) install -U pip
|
|
$(PIP) install -r requirements.txt
|
|
|
|
up:
|
|
docker compose up -d
|
|
@echo "MinIO API: http://localhost:9000"
|
|
@echo "MinIO console: http://localhost:9001 (minioadmin / minioadmin)"
|
|
|
|
down:
|
|
docker compose down
|
|
|
|
clean:
|
|
docker compose down -v
|
|
|
|
logs:
|
|
docker compose logs -f minio
|
|
|
|
seed:
|
|
@if [ -z "$$SOURCE_DIR" ]; then echo "set SOURCE_DIR=<path-to-pdfs>"; exit 2; fi
|
|
$(PY) seed.py "$$SOURCE_DIR"
|
|
|
|
invoke:
|
|
$(PY) invoke.py
|
|
|
|
console:
|
|
xdg-open http://localhost:9001 >/dev/null 2>&1 || true
|
|
|
|
docs/graphs/%.svg: docs/graphs/%.dot
|
|
dot -Tsvg $< -o $@
|
|
|
|
graphs: $(SVG_OUT)
|
|
@echo "rendered $(words $(SVG_OUT)) svg(s) from $(words $(DOT_SRC)) dot file(s)"
|
|
|
|
docs: $(SVG_OUT)
|
|
xdg-open docs/index.html >/dev/null 2>&1 || echo "open docs/index.html in your browser"
|