-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
80 lines (70 loc) · 1.72 KB
/
Taskfile.yml
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
version: '3'
vars:
PROJECT_DIR:
sh: pwd
IMAGE: ingtranet/benthos-operator
TAG:
sh: git describe --tag --exact-match || echo "latest"
tasks:
default:
deps:
- manifests
- generate
go-get-tool:
cmds:
- |
TEMP_DIR=$(mktemp -d) ;\
cd $TEMP_DIR ;\
go mod init tmp ;\
echo "Downloading {{.PACKAGE}}" ;\
GOBIN={{.PROJECT_DIR}}/bin go get {{.PACKAGE}} ;\
rm -rf $TEMP_DIR
go-get-controller-gen:
cmds:
- task: go-get-tool
vars:
PACKAGE: sigs.k8s.io/controller-tools/cmd/[email protected]
sources:
- Taskfile.yml
generates:
- bin/controller-gen
go-get-kustomize:
cmds:
- task: go-get-tool
vars:
PACKAGE: sigs.k8s.io/kustomize/kustomize/[email protected]
sources:
- Taskfile.yml
generates:
- bin/kustomize
go-get-kubectl-slice:
cmds:
- task: go-get-tool
vars:
PACKAGE: github.com/patrickdappollonio/[email protected]
sources:
- Taskfile.yml
generates:
- bin/kubectl-slice
manifests:
deps:
- go-get-controller-gen
cmds:
- bin/controller-gen rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
generate:
deps:
- go-get-controller-gen
cmds:
- bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
docker-test:
deps:
- manifests
- generate
cmds:
- docker run -it -v {{.PROJECT_DIR}}:/app golang:1.17 /bin/bash -c "cp -r /app /app_copy; cd /app_copy; rm -rf bin; make test"
docker-build:
deps:
- manifests
- generate
cmds:
- docker build -t {{.IMAGE}}:{{.TAG}} .