-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtasks_tools.yaml
More file actions
192 lines (182 loc) · 6.36 KB
/
Copy pathtasks_tools.yaml
File metadata and controls
192 lines (182 loc) · 6.36 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
version: 3
tasks:
localbin:
desc: " Ensure that the folder specified in LOCALBIN exists."
run: once
requires:
vars:
- LOCALBIN
status:
- test -d {{.LOCALBIN}}
cmds:
- 'echo "localbin: {{.LOCALBIN}}"'
- mkdir -p {{.LOCALBIN}}
internal: true
localtmp:
desc: " Ensure that the folder specified in LOCALTMP exists."
run: once
requires:
vars:
- LOCALTMP
status:
- test -d {{.LOCALTMP}}
cmds:
- 'echo "localtmp: {{.LOCALTMP}}"'
- mkdir -p {{.LOCALTMP}}
internal: true
controller-gen:
desc: " Ensure that controller-gen is installed."
run: once
requires:
vars:
- CONTROLLER_GEN
deps:
- localbin
vars:
# renovate: datasource=github-releases depName=controller-tools packageName=kubernetes-sigs/controller-tools
CONTROLLER_GEN_VERSION: '{{ env "CONTROLLER_GEN_VERSION" | default ( .CONTROLLER_GEN_VERSION | default "v0.20.1" ) }}'
status:
- test -x {{.CONTROLLER_GEN}}
- '{{.CONTROLLER_GEN}} --version | grep -q "{{.CONTROLLER_GEN_VERSION}}"'
cmds:
- 'GOBIN="{{.LOCALBIN}}" go install sigs.k8s.io/controller-tools/cmd/controller-gen@{{.CONTROLLER_GEN_VERSION}}'
internal: true
goimports:
desc: " Ensure that goimports is installed."
run: once
requires:
vars:
- FORMATTER
deps:
- localbin
vars:
# renovate: datasource=github-tags depName=tools packageName=golang/tools
FORMATTER_VERSION: '{{ env "FORMATTER_VERSION" | default ( .FORMATTER_VERSION | default "v0.43.0" ) }}'
status:
- test -x {{.FORMATTER}}
- test -f {{.LOCALBIN}}/formatter_version
- 'cat {{.LOCALBIN}}/formatter_version | grep -q "{{.FORMATTER_VERSION}}"'
cmds:
- 'GOBIN="{{.LOCALBIN}}" go install golang.org/x/tools/cmd/goimports@{{.FORMATTER_VERSION}}'
- echo -n "{{.FORMATTER_VERSION}}" > {{.LOCALBIN}}/formatter_version
internal: true
golangci-lint:
desc: " Ensure that golangci-lint is installed."
run: once
requires:
vars:
- LINTER
deps:
- localbin
vars:
# renovate: datasource=github-releases depName=golangci-lint packageName=golangci/golangci-lint
LINTER_VERSION: '{{ env "LINTER_VERSION" | default ( .LINTER_VERSION | default "v2.11.3" ) }}'
status:
- test -x {{.LINTER}}
- '{{.LINTER}} --version | grep -q {{.LINTER_VERSION | trimPrefix "v"}}'
- '{{.LINTER}} --version | grep -q "$(go env GOVERSION)"'
cmds:
- 'GOBIN="{{.LOCALBIN}}" go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@{{.LINTER_VERSION}}'
internal: true
jq:
desc: " Ensure that jq is installed."
run: once
requires:
vars:
- JQ
deps:
- localbin
vars:
# renovate: datasource=github-releases depName=jq packageName=jqlang/jq
JQ_VERSION: '{{ env "JQ_VERSION" | default ( .JQ_VERSION | default "v1.7.1" ) }}'
JQ_OS:
sh: 'if [[ "{{.OS}}" == "darwin" ]]; then echo "macos"; else echo "{{.OS}}"; fi' # jq uses 'macos' instead of 'darwin'
status:
- test -x {{.JQ}}
- '{{.JQ}} --version | grep -q "{{.JQ_VERSION | trimPrefix "v"}}"'
cmds:
- 'curl -sfL "https://github.com/jqlang/jq/releases/download/jq-{{.JQ_VERSION | trimPrefix "v"}}/jq-{{.JQ_OS}}-{{.ARCH}}" --output "{{.JQ}}"'
- 'chmod +x "{{.JQ}}"'
internal: true
helm:
desc: " Ensure that helm is installed."
run: once
requires:
vars:
- HELM
deps:
- localbin
vars:
# renovate: datasource=github-releases depName=helm packageName=helm/helm
HELM_VERSION: '{{ env "HELM_VERSION" | default ( .HELM_VERSION | default "v4.2.0" ) }}'
tmpdir:
sh: 'mktemp -d'
status:
- test -x "{{.HELM}}"
- '"{{.HELM}}" version --short | grep -q {{.HELM_VERSION}}'
cmds:
- 'mkdir -p {{.tmpdir}}/helm-unpacked'
- 'curl -sfL "https://get.helm.sh/helm-{{.HELM_VERSION}}-{{.OS}}-{{.ARCH}}.tar.gz" --output "{{.tmpdir}}/helm.tar.gz"'
- 'tar -xzf "{{.tmpdir}}/helm.tar.gz" --directory "{{.tmpdir}}/helm-unpacked"'
- 'mv "{{.tmpdir}}/helm-unpacked/{{.OS}}-{{.ARCH}}/helm" "{{.HELM}}"'
- 'chmod +x "{{.HELM}}"'
- 'rm -rf "{{.tmpdir}}"'
internal: true
yaml2json:
desc: " Ensure that yaml2json is installed."
run: once
requires:
vars:
- YAML2JSON
deps:
- localbin
vars:
# renovate: datasource=github-releases depName=yaml2json packageName=bronze1man/yaml2json
YAML2JSON_VERSION: '{{ env "YAML2JSON_VERSION" | default ( .YAML2JSON_VERSION | default "v1.3.5" ) }}'
status:
- 'test -x "{{.YAML2JSON}}"'
- '"{{.YAML2JSON}}" --version | grep -q "{{.YAML2JSON_VERSION | trimPrefix "v"}}"'
cmds:
- 'curl -sfL "https://github.com/bronze1man/yaml2json/releases/download/{{.YAML2JSON_VERSION}}/yaml2json_{{.OS}}_{{.ARCH}}" --output "{{.LOCALBIN}}/yaml2json"'
- 'chmod +x "{{.YAML2JSON}}"'
internal: true
ocm:
desc: " Ensure that the ocm CLI is installed."
run: once
requires:
vars:
- OCM
deps:
- localbin
status:
- 'test -x "{{.OCM}}"'
- '"{{.OCM}}" --version | grep -q "{{.OCM_VERSION | trimPrefix "v"}}"'
vars:
# renovate: datasource=github-releases depName=ocm packageName=open-component-model/ocm
OCM_VERSION: '{{ env "OCM_VERSION" | default ( .OCM_VERSION | default "v0.37.0" ) }}'
tmpdir:
sh: 'mktemp -d'
cmds:
- 'curl -sSfL https://ocm.software/install.sh | OCM_VERSION="{{.OCM_VERSION | trimPrefix "v"}}" bash -s "{{.tmpdir}}"'
- 'mv "{{.tmpdir}}/ocm" "{{.OCM}}"'
internal: true
envtest:
desc: " Ensure that envtest is installed."
run: once
requires:
vars:
- ENVTEST
deps:
- localbin
vars:
ENVTEST_VERSION: '{{ env "ENVTEST_VERSION" | default ( .ENVTEST_VERSION | default "release-0.23" ) }}'
ENVTEST_K8S_VERSION: '{{ env "ENVTEST_K8S_VERSION" | default ( .ENVTEST_K8S_VERSION | default "1.30.0" ) }}'
status:
- 'test -x "{{.ENVTEST}}"'
- test -f {{.LOCALBIN}}/envtest_version
- 'cat {{.LOCALBIN}}/envtest_version | grep -q "{{.ENVTEST_VERSION}}"'
cmds:
- 'GOBIN="{{.LOCALBIN}}" go install sigs.k8s.io/controller-runtime/tools/setup-envtest@{{.ENVTEST_VERSION}}'
- echo -n "{{.ENVTEST_VERSION}}" > {{.LOCALBIN}}/envtest_version
- '{{.ROOT_DIR}}/bin/setup-envtest use {{.ENVTEST_K8S_VERSION}} -p path > {{.LOCALBIN}}/assets_path'
internal: true