-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
171 lines (136 loc) · 3.87 KB
/
Taskfile.yaml
File metadata and controls
171 lines (136 loc) · 3.87 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
version: "3"
vars:
IMG: ghcr.io/rebertim/cairn
AGENT_IMG: ghcr.io/rebertim/cairn-agent
VERSION:
sh: git describe --tags --always --dirty 2>/dev/null || echo "dev"
COMMIT:
sh: git rev-parse --short HEAD 2>/dev/null || echo "unknown"
tasks:
default:
desc: Show available tasks
cmds:
- task --list
# ── Code Generation ──
generate:
desc: Run controller-gen to generate DeepCopy implementations
cmds:
- controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
manifests:
desc: Generate CRD manifests, RBAC, and webhook configs
cmds:
- controller-gen rbac:roleName=cairn-manager crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
api-gen:
desc: Generate Go server stubs from OpenAPI spec
cmds:
- oapi-codegen -generate types,server,spec -package api internal/api/openapi.yaml > internal/api/generated.go
# ── Development ──
run:
desc: Run the operator locally against current kubeconfig
cmds:
- go run ./cmd/ --zap-devel
dev:setup:
desc: Create a kind cluster with Prometheus for local development
cmds:
- bash hack/setup-kind.sh
dev:teardown:
desc: Delete the local kind cluster
cmds:
- kind delete cluster --name cairn-dev
install-crds:
desc: Install CRDs into the current cluster
cmds:
- kubectl apply -k config/crd
fmt:
desc: Format Go code
cmds:
- gofmt -s -w .
- goimports -w -local github.com/rebertim/cairn .
# ── Build ──
build:
desc: Build operator binary
cmds:
- go build -trimpath -ldflags "-s -w -X github.com/rebertim/cairn/internal/version.Version={{.VERSION}} -X github.com/rebertim/cairn/internal/version.Commit={{.COMMIT}}" -o bin/cairn ./cmd/
build:cli:
desc: Build CLI binary
cmds:
- go build -trimpath -ldflags "-s -w -X github.com/rebertim/cairn/internal/version.Version={{.VERSION}}" -o bin/cairn-cli ./cmd/cli/
build:image:
desc: Build container image with ko
env:
KO_DOCKER_REPO: "{{.IMG}}"
VERSION: "{{.VERSION}}"
GIT_COMMIT: "{{.COMMIT}}"
cmds:
- ko build ./cmd/
build:agent:
desc: Build the JVM agent JAR
dir: agent
cmds:
- gradle build
build:dashboard:
desc: Build the web dashboard
dir: dashboard
cmds:
- npm ci
- npm run build
# ── Test ──
test:
desc: Run unit and integration tests
cmds:
- go test -race -coverprofile=coverage.out ./...
test:e2e:
desc: Run E2E tests with chainsaw
cmds:
- chainsaw test --test-dir test/e2e/
test:coverage:
desc: Open coverage report in browser
cmds:
- go tool cover -html=coverage.out
# ── Lint ──
lint:
desc: Run golangci-lint
cmds:
- golangci-lint run
lint:fix:
desc: Run golangci-lint with auto-fix
cmds:
- golangci-lint run --fix
# ── Verify ──
verify:
desc: Verify generated code is up to date
cmds:
- task: generate
- task: manifests
- git diff --exit-code || (echo "Generated files are stale. Run 'task generate manifests' and commit." && exit 1)
# ── Release ──
release:snapshot:
desc: Build a snapshot release (no publish)
cmds:
- goreleaser release --snapshot --clean
release:
desc: Create a release (triggered by git tag)
cmds:
- goreleaser release --clean
# ── Docs ──
docs:serve:
desc: Serve documentation locally
dir: docs
env:
NO_MKDOCS_2_WARNING: "1"
cmds:
- mkdocs serve
docs:build:
desc: Build documentation
dir: docs
env:
NO_MKDOCS_2_WARNING: "1"
cmds:
- mkdocs build --strict
# ── Clean ──
clean:
desc: Remove build artifacts
cmds:
- rm -rf bin/ dist/ coverage.out
- rm -rf agent/build/
- rm -rf dashboard/dist/