This commit is contained in:
Jonas Bengtsson
2026-09-16 06:08:37 +02:00
parent cce6a4960e
commit 8d2c54beae
54 changed files with 8480 additions and 41 deletions
+42
View File
@@ -0,0 +1,42 @@
# MQTT Management Platform — Release 1 developer commands
# All commands assume a POSIX shell; on Windows use WSL/Git Bash or run the
# docker compose commands directly in PowerShell/cmd.
COMPOSE ?= docker compose
B ?= mqtt-backend
.PHONY: up down logs ps bootstrap migrate revision backend-shell test fmt lint
# --- Lifecycle -------------------------------------------------------------
up: ## Start the whole stack in the background
$(COMPOSE) up -d --build
down: ## Stop the stack (volumes are preserved)
$(COMPOSE) down
ps: ## Show service status
$(COMPOSE) ps
logs: ## Tail all logs
$(COMPOSE) logs -f
# --- Database --------------------------------------------------------------
migrate: ## Apply Alembic migrations inside the running backend
$(COMPOSE) exec $(B) alembic upgrade head
revision: ## Create an empty Alembic revision (autogenerate)
$(COMPOSE) exec $(B) alembic revision --autogenerate -m "$(m)"
backend-shell: ## Shell into the backend container
$(COMPOSE) exec $(B) sh
# --- Tests -----------------------------------------------------------------
test: ## Run backend test suite inside the container
$(COMPOSE) run --rm $(B) pytest -q
# --- Quality ---------------------------------------------------------------
fmt: ## Format backend sources
$(COMPOSE) run --rm $(B) ruff format app tests
lint: ## Lint backend sources
$(COMPOSE) run --rm $(B) ruff check app tests