feat(dev): make local-dev targets for one-keystroke LOCAL_DEV_MODE startup (#33)
* 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.
This commit is contained in:
parent
9b5214ea6f
commit
cbb7733987
1 changed files with 25 additions and 5 deletions
30
Makefile
30
Makefile
|
|
@ -1,13 +1,18 @@
|
||||||
# Agnes AI Data Analyst — Development Makefile
|
# Agnes AI Data Analyst — Development Makefile
|
||||||
|
|
||||||
.PHONY: help test lint dev docker update-openapi-snapshot
|
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:
|
help:
|
||||||
@echo "Available targets:"
|
@echo "Available targets:"
|
||||||
@echo " make test Run test suite"
|
@echo " make test Run test suite"
|
||||||
@echo " make dev Start FastAPI dev server"
|
@echo " make dev Start FastAPI dev server (native uvicorn)"
|
||||||
@echo " make docker Build and start Docker Compose"
|
@echo " make docker Build and start Docker Compose"
|
||||||
@echo " make lint Run ruff linter (if installed)"
|
@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:
|
test:
|
||||||
pytest tests/ -v --tb=short
|
pytest tests/ -v --tb=short
|
||||||
|
|
@ -18,6 +23,21 @@ dev:
|
||||||
docker:
|
docker:
|
||||||
docker compose up --build
|
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:
|
lint:
|
||||||
@ruff check . 2>/dev/null || echo "ruff not installed: pip install ruff"
|
@ruff check . 2>/dev/null || echo "ruff not installed: pip install ruff"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue