-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (52 loc) · 2.46 KB
/
Copy pathMakefile
File metadata and controls
61 lines (52 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.PHONY: up down smoke lint rollout-status demo-image help
KIND_CLUSTER := stackup
HELM_CHART := helm/demo
NAMESPACE := app
DEMO_IMAGE := stackup-demo:v1
ROLLOUT := demo
help:
@echo "stackup Makefile"
@echo ""
@echo " make up Full bring-up: scripts/bootstrap.sh (ordered, each step waited)"
@echo " make down Tear down: delete kind cluster (clean)"
@echo " make demo-image Build the demo workload image + side-load it into kind"
@echo " make smoke Run smoke tests (helm render + validate; no cluster needed)"
@echo " make lint Lint all YAML files + Helm charts"
@echo " make rollout-status Watch the demo Argo Rollout canary progress"
@echo ""
@echo "Prerequisites: docker, kind, helm >=3.15, kubectl, git, bash"
# `up` is a thin wrapper over scripts/bootstrap.sh. The script owns the
# ordering + per-step `kubectl wait` gates (kind -> Calico -> namespace ->
# sealed-secrets -> SealedSecrets -> ingress/cert-manager/prometheus ->
# Argo Rollouts/ArgoCD -> demo workload -> app-of-apps). Keeping the
# orchestration in one place (not split between this target and the
# script) is why the target is a one-liner.
up:
@bash scripts/bootstrap.sh
# Build + side-load the demo image without a full bring-up. Handy when
# iterating on the workload, or to stage a "bad" image for the rollback
# demo: make demo-image DEMO_IMAGE=stackup-demo:v2 then rebuild with
# --build-arg FAILURE_RATE=0.3 (see apps/demo/Dockerfile).
demo-image:
docker build -t $(DEMO_IMAGE) apps/demo
kind load docker-image $(DEMO_IMAGE) --name $(KIND_CLUSTER)
down:
@echo "=== Deleting kind cluster ==="
kind delete cluster --name $(KIND_CLUSTER)
@echo "Cluster deleted. Run 'make up' to bring it back up."
smoke:
@echo "=== Running smoke tests ==="
@bash scripts/smoke-test.sh
lint:
@echo "=== Linting YAML files ==="
@find . -name "*.yaml" -o -name "*.yml" | grep -v node_modules | while read f; do \
python3 -c "import yaml; yaml.safe_load(open('$$f'))" 2>/dev/null && echo "✓ $$f" || echo "✗ $$f: YAML parse error"; \
done || true
@echo ""
@echo "=== Helm lint ==="
@for chart in helm/demo helm/buyerchat; do \
helm lint $$chart --quiet && echo "✓ helm lint $$chart passed" || echo "✗ helm lint $$chart failed"; \
helm template $$(basename $$chart) $$chart > /dev/null 2>&1 && echo "✓ helm template $$chart passed" || echo "✗ helm template $$chart failed"; \
done
rollout-status:
kubectl argo rollouts get rollout $(ROLLOUT) -n $(NAMESPACE) --watch