# Makefile for building and pushing multi-arch Docker images IMAGE_REPO = git.coopcloud.tech/wiki-cafe/member-console DATE_TAG = $(shell date -u +%Y-%m-%dT%H-%MZ) # PLATFORMS = linux/arm64,linux/amd64 PLATFORMS = linux/amd64 .PHONY: docker-push docker-push: docker buildx build \ --platform $(PLATFORMS) \ -t $(IMAGE_REPO):latest \ -t $(IMAGE_REPO):$(DATE_TAG) \ --push . # Database migration targets .PHONY: sqlc-generate sqlc-generate: cd internal/db && sqlc generate # Build the application .PHONY: build build: go build -o member-console . # Lint: ensure no handler bypasses SafeTemplates by writing directly to ResponseWriter. # All template rendering must go through h.Templates.Render() — see internal/server/render.go. .PHONY: lint-templates lint-templates: @if grep -rn '\.ExecuteTemplate(w,' internal/server/; then \ echo "ERROR: Direct ExecuteTemplate on ResponseWriter found. Use h.Templates.Render() instead."; \ exit 1; \ else \ echo "OK: No direct ExecuteTemplate on ResponseWriter detected."; \ fi