Repository Public
1# MacLustr Command Center — reproducible local CI (no hosted CI exists on this infrastructure).2# `make ci` is the gate; the pre-push hook (make hooks) runs it.3SHELL := /bin/bash4GO := cd services && go5VERSION ?= $(shell cat VERSION 2>/dev/null || git describe --tags --always --dirty 2>/dev/null || echo dev)6COMMIT := $(shell cat COMMIT 2>/dev/null || git rev-parse --short HEAD 2>/dev/null)7BUILT := $(shell date -u +%Y-%m-%dT%H:%M:%SZ)8LDFLAGS := -s -w -X clustr.spboucher.ai/mcc/internal/api.Version=$(VERSION) -X clustr.spboucher.ai/mcc/internal/api.Commit=$(COMMIT) -X clustr.spboucher.ai/mcc/internal/api.BuiltAt=$(BUILT) -X clustr.spboucher.ai/mcc/internal/buildinfo.Version=$(VERSION) -X clustr.spboucher.ai/mcc/internal/buildinfo.Commit=$(COMMIT) -X clustr.spboucher.ai/mcc/internal/buildinfo.Date=$(BUILT) -X main.Version=$(VERSION)910.PHONY: web-release ci gen gen-check fmt-check vet test test-race build agents web web-ci tokens hooks sbom vuln clean1112ci: gen-check fmt-check vet test web-ci ## everything that must pass before a push1314gen: ## regenerate code from the contract and tokens15 python3 tools/gen-api.py16 node packages/ui-tokens/build.mjs1718gen-check:19 python3 tools/gen-api.py --check20 node packages/ui-tokens/build.mjs --check2122fmt-check:23 @out=$$(cd services && gofmt -l . | grep -v '_gen.go' | grep -v '/gen.go' || true); if [ -n "$$out" ]; then echo "gofmt needed:"; echo "$$out"; exit 1; fi2425vet:26 $(GO) vet ./...2728test:29 $(GO) test -count=1 ./...3031test-race:32 $(GO) test -count=1 -race ./...3334build: ## backend binaries for the host node (darwin/arm64)35 mkdir -p dist36 cd services && for b in control-api telemetry-ingest action-orchestrator mccctl; do \37 CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -trimpath -ldflags "$(LDFLAGS)" -o ../dist/$$b ./cmd/$$b || exit 1; done38 cd dist && shasum -a 256 control-api telemetry-ingest action-orchestrator mccctl > SHA256SUMS.backend3940agents: ## agent binaries for every platform41 bash agents/build.sh4243web:44 cd apps/web && pnpm install --frozen-lockfile && pnpm build4546web-release: ## Next standalone server assembled in dist/web (run with: node dist/web/server.js)47 cd apps/web && pnpm install --frozen-lockfile && pnpm build48 rm -rf dist/web && mkdir -p dist/web49 cp -R apps/web/.next/standalone/. dist/web/50 @if [ -d dist/web/apps/web ]; then cp -R dist/web/apps/web/. dist/web/ && rm -rf dist/web/apps; fi51 mkdir -p dist/web/.next && cp -R apps/web/.next/static dist/web/.next/static52 @if [ -d apps/web/public ]; then cp -R apps/web/public dist/web/public; fi5354web-ci:55 @if [ -f apps/web/package.json ]; then cd apps/web && pnpm install --frozen-lockfile && pnpm gen:api --check && pnpm typecheck && pnpm lint && pnpm test; else echo "apps/web not present yet"; fi5657tokens:58 node packages/ui-tokens/build.mjs5960sbom: ## software bill of materials (Go modules + npm), written to dist/sbom/61 mkdir -p dist/sbom62 cd services && go list -m -json all > ../dist/sbom/go-modules.json63 @if [ -f apps/web/pnpm-lock.yaml ]; then cd apps/web && pnpm licenses list --json > ../../dist/sbom/web-licenses.json 2>/dev/null || true; pnpm list --prod --depth Infinity --json > ../../dist/sbom/web-dependencies.json; fi6465vuln: ## known-vulnerability scan of dependencies66 cd services && go run golang.org/x/vuln/cmd/govulncheck@latest ./...67 @if [ -f apps/web/package.json ]; then cd apps/web && pnpm audit --prod; fi6869hooks:70 printf '#!/bin/sh\nexec make ci\n' > .git/hooks/pre-push && chmod +x .git/hooks/pre-push7172clean:73 rm -rf dist74