* feat(dev): add make local-dev targets wrapping run-local-dev.sh `make local-dev` runs scripts/run-local-dev.sh so docker compose + the LOCAL_DEV_MODE overlay are one keystroke away. `make local-dev-down` and `make local-dev-logs` manage the same 3-file stack. * fix(make): ensure .env exists before local-dev-down / local-dev-logs docker-compose.yml declares `env_file: .env` for several services (extract, telegram-bot, ws-gateway, …). Compose validates those paths during config parsing even for profiled services that never start, so a missing .env breaks `make local-dev-down` and `make local-dev-logs`. Add .env as a file-target prerequisite — touched on demand, so no-op when already present. Addresses Devin review on #33.
46 lines
1.5 KiB
Makefile
46 lines
1.5 KiB
Makefile
# Agnes AI Data Analyst — Development Makefile
|
|
|
|
LOCAL_DEV_COMPOSE := -f docker-compose.yml -f docker-compose.override.yml -f docker-compose.local-dev.yml
|
|
|
|
.PHONY: help test lint dev docker local-dev local-dev-down local-dev-logs update-openapi-snapshot
|
|
|
|
help:
|
|
@echo "Available targets:"
|
|
@echo " make test Run test suite"
|
|
@echo " make dev Start FastAPI dev server (native uvicorn)"
|
|
@echo " make docker Build and start Docker Compose"
|
|
@echo " make local-dev Start Agnes with LOCAL_DEV_MODE=1 (auth bypass, no .env needed)"
|
|
@echo " make local-dev-down Stop and remove the local-dev stack"
|
|
@echo " make local-dev-logs Tail logs from the local-dev stack"
|
|
@echo " make lint Run ruff linter (if installed)"
|
|
|
|
test:
|
|
pytest tests/ -v --tb=short
|
|
|
|
dev:
|
|
uvicorn app.main:app --reload
|
|
|
|
docker:
|
|
docker compose up --build
|
|
|
|
local-dev:
|
|
./scripts/run-local-dev.sh
|
|
|
|
# docker-compose.yml declares `env_file: .env` on several services; compose
|
|
# validates those paths even for profiled services that never start. Create
|
|
# the file on demand so down/logs work even if the user never ran local-dev.
|
|
.env:
|
|
@touch $@
|
|
|
|
local-dev-down: .env
|
|
docker compose $(LOCAL_DEV_COMPOSE) down
|
|
|
|
local-dev-logs: .env
|
|
docker compose $(LOCAL_DEV_COMPOSE) logs -f
|
|
|
|
lint:
|
|
@ruff check . 2>/dev/null || echo "ruff not installed: pip install ruff"
|
|
|
|
update-openapi-snapshot:
|
|
TESTING=1 python scripts/generate_openapi.py > tests/snapshots/openapi.json
|
|
@echo "Snapshot updated. Review diff and commit."
|