ec3d4229e3
`make reindex` and `make reindex-obsidian` built a `python -c` string with backslash continuations, which kept the tab indentation inside the code, so Python failed with IndentationError. The targets now call the existing `scripts.manage_vectorstore` CLI. Its `reindex` wiped everything but only re-indexed Paperless, dropping Obsidian notes; it now indexes both, and a new `reindex-obsidian` command re-embeds only the vault. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
93 lines
2.7 KiB
Makefile
93 lines
2.7 KiB
Makefile
.PHONY: deploy redeploy build up down restart logs migrate migrate-new migrate-history frontend desktop desktop-dev test test-cov reindex reindex-obsidian ynab-sync ynab-resync
|
|
|
|
# Blue-green: detect the running color (default blue when nothing is running)
|
|
ACTIVE_COLOR := $(shell docker compose ps --status running --services 2>/dev/null | grep -oE 'raggr-(blue|green)' | head -1 | cut -d- -f2)
|
|
ifeq ($(ACTIVE_COLOR),)
|
|
ACTIVE_COLOR := blue
|
|
endif
|
|
RAGGR := raggr-$(ACTIVE_COLOR)
|
|
# Both profiles enabled for commands that only touch existing containers
|
|
# (never use this with `up`, which would start both colors)
|
|
COMPOSE := docker compose --profile blue --profile green
|
|
|
|
# Build and deploy
|
|
deploy: build up
|
|
|
|
# Zero-downtime blue-green swap (see scripts/deploy.sh)
|
|
redeploy:
|
|
git pull && ./scripts/deploy.sh
|
|
|
|
build:
|
|
docker compose --profile $(ACTIVE_COLOR) build $(RAGGR)
|
|
|
|
up:
|
|
docker compose --profile $(ACTIVE_COLOR) up -d
|
|
|
|
down:
|
|
$(COMPOSE) down
|
|
|
|
restart:
|
|
$(COMPOSE) restart $(RAGGR)
|
|
|
|
logs:
|
|
$(COMPOSE) logs -f $(RAGGR)
|
|
|
|
# Vector store reindexing
|
|
reindex:
|
|
$(COMPOSE) exec $(RAGGR) python -m scripts.manage_vectorstore reindex
|
|
|
|
reindex-obsidian:
|
|
$(COMPOSE) exec $(RAGGR) python -m scripts.manage_vectorstore reindex-obsidian
|
|
|
|
# YNAB mirror: delta sync, or full re-download
|
|
ynab-sync:
|
|
$(COMPOSE) exec $(RAGGR) python -m blueprints.ynab
|
|
|
|
ynab-resync:
|
|
$(COMPOSE) exec $(RAGGR) python -m blueprints.ynab --full
|
|
|
|
# Database migrations
|
|
migrate:
|
|
$(COMPOSE) exec $(RAGGR) aerich upgrade
|
|
|
|
migrate-new:
|
|
@./scripts/migrate-new.sh
|
|
|
|
migrate-history:
|
|
$(COMPOSE) exec $(RAGGR) aerich history
|
|
|
|
# Tests
|
|
test:
|
|
OPENAI_API_KEY=synthetic-unit-test-key TAVILY_API_KEY=synthetic-unit-test-key uv run --frozen --extra test pytest tests/unit -v
|
|
|
|
test-cov:
|
|
OPENAI_API_KEY=synthetic-unit-test-key TAVILY_API_KEY=synthetic-unit-test-key uv run --frozen --extra test pytest tests/unit -v --cov
|
|
|
|
# Frontend
|
|
frontend:
|
|
cd raggr-frontend && npm ci && npm run build
|
|
|
|
# Desktop app (Tauri). Point it at the server with SIMBA_URL, e.g.
|
|
# make desktop-dev SIMBA_URL=https://simba.example.com
|
|
# SIMBA_URL is read at runtime and baked in at build time as the default.
|
|
desktop-dev:
|
|
cd desktop && npm install && SIMBA_URL=$(SIMBA_URL) npx tauri dev
|
|
|
|
desktop:
|
|
cd desktop && npm install && SIMBA_URL=$(SIMBA_URL) npx tauri build --bundles app
|
|
rm -rf /Applications/Simba.app
|
|
cp -R desktop/src-tauri/target/release/bundle/macos/Simba.app /Applications/
|
|
|
|
.PHONY: lint evaluate validate-config frontend-check
|
|
lint:
|
|
uvx ruff==0.8.2 check .
|
|
|
|
evaluate:
|
|
uv run --frozen --extra test python -m scripts.evaluate_context
|
|
|
|
validate-config:
|
|
uv run --frozen python scripts/validate_config.py
|
|
|
|
frontend-check:
|
|
cd raggr-frontend && npm ci && node --test tests/*.test.cjs && npx --no-install tsc --noEmit && npm run build
|