-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
156 lines (130 loc) · 6.12 KB
/
Taskfile.yml
File metadata and controls
156 lines (130 loc) · 6.12 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
version: "3"
vars:
IMG: bootchain-operator:latest
CRD_NAME: core.bootchain-operator.ruicoelho.dev_bootdependencies.yaml
HELM_RELEASE: bootchain-operator
HELM_NAMESPACE: bootchain-operator-system
WEBHOOK_CERT_DIR: /tmp/bootchain-webhook-certs
tasks:
# ── Code generation (delegates to Makefile) ─────────────────────────────────
generate:
desc: Regenerate DeepCopy methods and CRD manifests
cmds:
- make generate manifests
# ── Build (delegates to Makefile) ───────────────────────────────────────────
build:
desc: Build the operator binary
cmds:
- make build
docker-build:
desc: Build the operator Docker image (IMG={{.IMG}})
cmds:
- make docker-build IMG={{.IMG}}
# ── Test / Lint (delegates to Makefile) ─────────────────────────────────────
test:
desc: Run unit and controller tests
cmds:
- make test
lint:
desc: Run golangci-lint
cmds:
- make lint
# ── CRD ─────────────────────────────────────────────────────────────────────
install-crd:
desc: Install the BootDependency CRD into the current cluster
cmds:
- kubectl apply -f config/crd/bases/{{.CRD_NAME}}
uninstall-crd:
desc: Remove the BootDependency CRD from the current cluster
cmds:
- kubectl delete -f config/crd/bases/{{.CRD_NAME}} --ignore-not-found
# ── Run locally ─────────────────────────────────────────────────────────────
run:
desc: Run the operator locally (controller only, webhooks disabled)
deps: [install-crd]
cmds:
- ENABLE_WEBHOOKS=false go run ./cmd/main.go
run-with-webhook:
desc: Run the operator locally with webhooks enabled (requires dev certs)
deps: [install-crd]
cmds:
- go run ./cmd/main.go
--webhook-cert-path={{.WEBHOOK_CERT_DIR}}
--webhook-cert-name=tls.crt
--webhook-cert-key=tls.key
webhook-proxy:
desc: Start socat proxy so the Colima VM (IPv4) can reach the webhook server (IPv6 socket on macOS)
cmds:
- socat TCP4-LISTEN:9444,fork,reuseaddr TCP6:[::1]:9443
# ── Webhook dev setup ────────────────────────────────────────────────────────
webhook-gen-certs:
desc: Generate self-signed TLS certs for local webhook development
cmds:
- bash hack/gen-dev-certs.sh
webhook-register:
desc: Register MutatingWebhookConfiguration and ValidatingWebhookConfiguration pointing to localhost
cmds:
- bash hack/register-dev-webhook.sh
webhook-enable-namespace:
desc: Label the default namespace to activate the dev webhook
cmds:
- kubectl label namespace default bootchain-webhook=enabled --overwrite
webhook-disable-namespace:
desc: Remove the webhook label from the default namespace
cmds:
- kubectl label namespace default bootchain-webhook- --overwrite || true
webhook-teardown:
desc: Remove the dev webhook configurations from the cluster
cmds:
- kubectl delete mutatingwebhookconfiguration bootchain-dev-webhook --ignore-not-found
- kubectl delete validatingwebhookconfiguration bootchain-dev-validating-webhook --ignore-not-found
webhook-setup:
desc: Full dev webhook setup (certs + register + label namespace)
cmds:
- task: webhook-gen-certs
- task: webhook-register
- task: webhook-enable-namespace
# ── Samples ──────────────────────────────────────────────────────────────────
apply-sample:
desc: Apply the sample BootDependency manifest
cmds:
- kubectl apply -f config/samples/core_v1alpha1_bootdependency.yaml
delete-sample:
desc: Delete the sample BootDependency manifest
cmds:
- kubectl delete -f config/samples/core_v1alpha1_bootdependency.yaml --ignore-not-found
# ── Helm ─────────────────────────────────────────────────────────────────────
helm-lint:
desc: Lint the Helm chart
cmds:
- helm lint charts/bootchain-operator
helm-template:
desc: Render Helm chart templates to stdout
cmds:
- helm template {{.HELM_RELEASE}} charts/bootchain-operator --namespace {{.HELM_NAMESPACE}}
helm-install:
desc: Install the Helm chart into the cluster (IMG=, HELM_RELEASE=, HELM_NAMESPACE=)
cmds:
- kubectl create namespace {{.HELM_NAMESPACE}} --dry-run=client -o yaml | kubectl apply -f -
- helm upgrade --install {{.HELM_RELEASE}} charts/bootchain-operator
--namespace {{.HELM_NAMESPACE}}
--set image.repository={{.IMG | replace ":latest" ""}}
--set image.tag=latest
--wait
helm-uninstall:
desc: Uninstall the Helm release from the cluster
cmds:
- helm uninstall {{.HELM_RELEASE}} --namespace {{.HELM_NAMESPACE}} --ignore-not-found
# ── Docs ─────────────────────────────────────────────────────────────────────
docs-serve:
desc: Serve the MkDocs documentation locally (with live reload)
cmds:
- source venv/bin/activate && mkdocs serve
docs-build:
desc: Build the MkDocs documentation into site/
cmds:
- source venv/bin/activate && mkdocs build --strict
docs-deploy:
desc: Deploy the MkDocs documentation to GitHub Pages
cmds:
- source venv/bin/activate && mkdocs gh-deploy --force