Files
home-network-k3s-impl/ci/Makefile
jakman85andClaude Opus 4.8 8c1368977e Phase 0 clarification follow-ups + reconcile CI integration seams
Adopt the spec's Phase-0 clarifications (spec now at pin a7fc19f) into the impl:
- schema v1.1: enforce exposure:public => auth.mode!=none (positive+negative tested).
- Kyverno: add longhorn=>size and longhorn=>NOT-reacquirable invariants (R-STATE-02/03).
- Ratify the homelab.keithjackson.dev/* label-key convention (now in spec docs/03).
- R-TEST-06 spec-immutability gate: ci/SPEC_PIN + ci/spec-immutability.sh + gate.sh
  stage + Makefile target + a Gitea job (checks spec repo clean & at pin).
- touched-requirements.sh: conformance tags are the authoritative source.

Reconcile 3 CI seams the CI worker flagged (gate was RED, now GREEN):
- create schemas/validate.sh (SCHEMA_VALIDATE_CMD entrypoint) — L0 schema gate runs.
- fix l1.sh/conformance.sh to run.sh's real interface (fixed _artifacts/ paths; no
  --junit/--coverage) and collect artifacts.
- exec bits on new scripts.

make -C ci gate => PASS (l0 skips locally w/o kyverno binary; green in CI).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-08-16 00:42:43 -05:00

50 lines
1.8 KiB
Makefile

# ci/Makefile — portable, single-command local equivalent of the Gitea Actions
# merge gate (R-TEST-02: the gates are runnable TODAY, without Gitea).
#
# The Gitea Actions workflow (.gitea/workflows/merge-gate.yaml) calls these exact
# scripts, so `make -C ci gate` locally == the CI merge gate. Run from anywhere:
# make -C ci gate
#
# Every stage is a thin wrapper over a ci/*.sh script; see ci/README.md.
SHELL := /usr/bin/env bash
CI_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
.DEFAULT_GOAL := help
.PHONY: help spec-immutability lint schema l0 l1 conformance gate all touched versions tools
help: ## Show this help
@awk 'BEGIN{FS=":.*##"} /^[a-zA-Z0-9_-]+:.*##/{printf " \033[36m%-14s\033[0m %s\n",$$1,$$2}' $(MAKEFILE_LIST)
spec-immutability: ## R-TEST-06: fail if the spec repo is modified or drifted from ci/SPEC_PIN
@"$(CI_DIR)spec-immutability.sh"
lint: ## yaml/lint (no cluster; live now)
@"$(CI_DIR)lint.sh"
schema l0: ## ServiceDefinition schema validation + Kyverno L0 policy gate (no cluster; live now)
@"$(CI_DIR)l0.sh"
l1: ## L1 rendering checks (no cluster; live now)
@"$(CI_DIR)l1.sh"
conformance: ## L2/L3 in-cluster Chainsaw Job (SKIPS w/o CLUSTER_AVAILABLE=true)
@"$(CI_DIR)conformance.sh"
gate: ## Full merge gate: all stages + R-TEST-03 decision (the single command)
@"$(CI_DIR)gate.sh"
all: gate ## Alias for `gate`
touched: ## Print the touched-requirement subset for the current branch vs main
@"$(CI_DIR)touched-requirements.sh"
versions: ## Print pinned tool versions (R-TEST-02)
@cat "$(CI_DIR)versions.env"
tools: ## Report which required tools are installed locally
@source "$(CI_DIR)versions.env"; \
for t in yamllint kyverno chainsaw kubectl yq git; do \
if command -v $$t >/dev/null 2>&1; then printf " \033[32mok\033[0m %s\n" "$$t"; \
else printf " \033[33mmiss\033[0m %s\n" "$$t"; fi; done