38 lines
1.0 KiB
Makefile
38 lines
1.0 KiB
Makefile
|
|
.PHONY: help dev install lint fmt open logs
|
|||
|
|
|
|||
|
|
VENV := .venv
|
|||
|
|
PYTHON := $(VENV)/bin/python
|
|||
|
|
UV := $(VENV)/bin/uvicorn
|
|||
|
|
APP := app.main:app
|
|||
|
|
PORT := $(shell grep -E '^PORT=' .env 2>/dev/null | cut -d= -f2 || echo 8001)
|
|||
|
|
|
|||
|
|
help:
|
|||
|
|
@echo "DevOpsDash local dev"
|
|||
|
|
@echo ""
|
|||
|
|
@echo " make dev – start uvicorn with auto-reload (uses .env)"
|
|||
|
|
@echo " make install – install/sync dependencies into .venv"
|
|||
|
|
@echo " make open – open browser at localhost:PORT"
|
|||
|
|
@echo " make fmt – format with black"
|
|||
|
|
@echo " make lint – ruff check"
|
|||
|
|
|
|||
|
|
install:
|
|||
|
|
python3 -m venv $(VENV)
|
|||
|
|
$(VENV)/bin/pip install -q -r requirements.txt
|
|||
|
|
|
|||
|
|
dev:
|
|||
|
|
@test -f .env || (echo "⚠ No .env found – copy .env.example first: cp .env.example .env" && exit 1)
|
|||
|
|
@echo "→ Starting DevOpsDash on http://localhost:$(PORT)"
|
|||
|
|
env $$(grep -v '^#' .env | xargs) \
|
|||
|
|
$(UV) $(APP) \
|
|||
|
|
--host 0.0.0.0 --port $(PORT) \
|
|||
|
|
--reload --reload-dir app
|
|||
|
|
|
|||
|
|
open:
|
|||
|
|
open http://localhost:$(PORT)
|
|||
|
|
|
|||
|
|
fmt:
|
|||
|
|
$(VENV)/bin/black app/
|
|||
|
|
|
|||
|
|
lint:
|
|||
|
|
$(VENV)/bin/ruff check app/
|