-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
128 lines (112 loc) · 3.65 KB
/
Taskfile.yaml
File metadata and controls
128 lines (112 loc) · 3.65 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
# Copyright 2025 Patryk Rostkowski
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
version: '3'
tasks:
kind:create:
desc: "Create kind cluster for controlplane development"
cmds:
- kind create cluster --name controlplane --wait 60s
kind:delete:
desc: "Delete kind cluster used for controlplane development"
cmds:
- kind delete cluster --name controlplane
kind:load-image:
desc: "Load locally built operator image into kind cluster"
deps:
- dev:build
cmds:
- kind load docker-image patrostkowski/controlplane-operator:latest --name controlplane
docs:
desc: "Serve controlplane MkDocs from ./docs/"
cmds:
- |
crdoc \
--resources config/crd/ \
--output docs/content/api-reference/crds.md
- docker build -t controlplane-docs -f docs/Dockerfile .
- |
docker run --rm -it -p 8000:8000 \
-v "${PWD}/docs:/docs:Z" \
controlplane-docs \
serve -f /docs/mkdocs.yml -a 0.0.0.0:8000
dev:setup:
desc: Validate local dev environment and install git hooks
cmds:
- |
set -euo pipefail
require() {
local bin="$1"
command -v "$bin" >/dev/null 2>&1 || {
echo "Missing required binary: $bin" >&2
exit 1
}
which $bin
}
require go
require docker
require kubectl
require helm
require kind
require pre-commit
require golangci-lint
require addlicense
require controller-gen
require crdoc
pre-commit install
dev:test:
desc: "Run unit tests"
cmds:
- go test ./pkg/... -v
dev:lint:
desc: "Run golangci-lint"
cmds:
- golangci-lint run ./...
dev:e2e:
desc: "Run E2E tests. Invoke with extra flags: `task dev:e2e -- -args --no-cleanup --stage=run`"
cmds:
- go test -tags=e2e ./e2e -v -count=1 -p 1 {{.CLI_ARGS}}
dev:codegen:
desc: "Run all code generation scripts (client + CRDs) inside hack/"
cmds:
- bash hack/update-codegen.sh
- bash hack/update-crds.sh
- addlicense -c "Patryk Rostkowski" -l apache -y 2025 .
dev:install:
desc: "Install controlplane CRDs into current kube context"
cmds:
- helm upgrade --install cert-manager "oci://quay.io/jetstack/charts/cert-manager"
--namespace cert-manager
--create-namespace
--set crds.enabled=true
- kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.15.3/config/manifests/metallb-native.yaml
- kubectl apply -f config/crd/
dev:run:
desc: "Run the controlplane operator locally (for development)"
dir: cmd/controlplane-operator
cmds:
- go run main.go
dev:docker-build:
desc: "Build controlplane operator Docker image"
cmds:
- docker build . -t patrostkowski/controlplane-operator:latest
dev:build:
cmds:
- go build -o bin/controlplane-operator ./cmd/controlplane-operator/
dev:build-tesseractl:
cmds:
- go build -o bin/tesseractl ./cmd/tesseractl/
dev:build-all:
deps:
- dev:build
- dev:build-tesseractl