-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
108 lines (77 loc) · 3.14 KB
/
Makefile
File metadata and controls
108 lines (77 loc) · 3.14 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
SERVICES := api-gateway identity seller catalog search pricing inventory cart checkout payments orders fulfillment notifications reviews analytics
dev:
docker compose up --build
down:
docker compose down -v
test:
@set -e; \
for svc in $(SERVICES); do \
echo "Running tests for $$svc"; \
( cd services/$$svc && npm ci && npm test ); \
done
lint:
npm run lint
npm --prefix frontend run lint
format-check:
npm --prefix frontend run format
format-fix:
cd frontend && npx prettier . --write
format-fix-cart:
cd frontend && npx prettier apps/web/app/cart/page.js --write
infra-init:
bash scripts/devctl.sh init
infra-plan:
bash scripts/devctl.sh plan
infra-apply:
bash scripts/devctl.sh apply
infra-destroy:
bash scripts/devctl.sh destroy
infra-status:
bash scripts/devctl.sh status
kubeconfig-dev:
bash scripts/devctl.sh kubeconfig
secret-kube-dev:
bash scripts/devctl.sh secret
deploy-dev:
bash scripts/devctl.sh deploy
infra-apply-ci:
bash scripts/devctl.sh ci-apply
infra-destroy-ci:
bash scripts/devctl.sh ci-destroy
infra-cleanup-ci:
bash scripts/devctl.sh ci-cleanup
gh-iac-init:
terraform -chdir=infra/terraform/envs/github init
gh-iac-plan:
terraform -chdir=infra/terraform/envs/github plan
gh-iac-apply:
terraform -chdir=infra/terraform/envs/github apply -auto-approve
gh-iac-destroy:
terraform -chdir=infra/terraform/envs/github destroy -auto-approve
ship-dev:
bash scripts/devctl.sh ship-dev
up-dev:
bash scripts/devctl.sh up
KUBECONFIG_DEV_FILE ?= /tmp/kubeconfig-dev.yaml
SLO_BURN_RATE_THRESHOLD ?= 2
SLO_ERROR_BUDGET_RATIO ?= 0.0005
SLO_SERVICES_REGEX ?= api-gateway|checkout|payments|orders
SLO_STATUS_REGEX ?= 5..
SLO_WINDOW ?= 5m
refresh-kubeconfig-dev:
KUBECONFIG_FILE=$(KUBECONFIG_DEV_FILE) bash scripts/devctl.sh kubeconfig
grafana-install:
KUBECONFIG_FILE=$(KUBECONFIG_DEV_FILE) bash scripts/devctl.sh kubeconfig >/dev/null
kubectl --kubeconfig $(KUBECONFIG_DEV_FILE) apply -f platform/k8s/observability/grafana/namespace.yaml
kubectl --kubeconfig $(KUBECONFIG_DEV_FILE) create secret generic grafana-admin -n observability --from-literal=username=admin --from-literal=password=adminadmin --dry-run=client -o yaml | kubectl --kubeconfig $(KUBECONFIG_DEV_FILE) apply -f -
kubectl --kubeconfig $(KUBECONFIG_DEV_FILE) apply -k platform/k8s/observability/grafana
grafana-port-forward:
KUBECONFIG_FILE=$(KUBECONFIG_DEV_FILE) bash scripts/devctl.sh kubeconfig >/dev/null
kubectl --kubeconfig $(KUBECONFIG_DEV_FILE) -n observability port-forward svc/grafana 3000:3000
grafana-uninstall:
KUBECONFIG_FILE=$(KUBECONFIG_DEV_FILE) bash scripts/devctl.sh kubeconfig >/dev/null
kubectl --kubeconfig $(KUBECONFIG_DEV_FILE) delete -k platform/k8s/observability/grafana --ignore-not-found=true
slo-gate-check:
bash scripts/slo-burn-rate-check.sh --threshold $(SLO_BURN_RATE_THRESHOLD) --error-budget-ratio $(SLO_ERROR_BUDGET_RATIO) --services "$(SLO_SERVICES_REGEX)" --status-regex "$(SLO_STATUS_REGEX)" --window $(SLO_WINDOW)
slo-gate-check-prod:
bash scripts/slo-burn-rate-check.sh --threshold 1 --error-budget-ratio $(SLO_ERROR_BUDGET_RATIO) --services "$(SLO_SERVICES_REGEX)" --status-regex "$(SLO_STATUS_REGEX)" --window $(SLO_WINDOW)