-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
Signed-off-by: Isteb4k <[email protected]>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
version: "3" | ||
|
||
silent: true | ||
|
||
env: | ||
K8S_CODEGEN: | ||
sh: echo $(go env GOMODCACHE)/$(go list -f '{{`{{.Path}}@{{.Version}}`}}' -m k8s.io/code-generator) | ||
|
||
tasks: | ||
generate: | ||
desc: "Regenerate all" | ||
deps: | ||
- _ensure:k8s-codegen-mod | ||
- _ensure:k8s-kube-openapi | ||
cmd: ./scripts/update-codegen.sh all | ||
|
||
generate:core: | ||
desc: "Regenerate code for core components." | ||
deps: | ||
- _ensure:k8s-codegen-mod | ||
cmd: ./scripts/update-codegen.sh core | ||
|
||
generate:subresources: | ||
desc: "Regenerate code for subresources components" | ||
deps: | ||
- _ensure:k8s-codegen-mod | ||
- _ensure:k8s-kube-openapi | ||
cmd: ./scripts/update-codegen.sh subresources | ||
|
||
ci:generate: | ||
desc: "Run generations and check git diff to ensure all files are committed" | ||
cmds: | ||
- task: generate | ||
- task: _ci:verify-gen | ||
|
||
_ci:verify-gen: | ||
desc: "Check generated files are up-to-date." | ||
internal: true | ||
cmds: | ||
- | | ||
git diff --exit-code || (echo "Please run task gen:api and commit changes" && exit 1) | ||
_ensure:k8s-codegen-mod: | ||
desc: "Ensure k8s.io/codegen module is present" | ||
internal: true | ||
cmds: | ||
- echo -e "Path K8S_CODEGEN=${K8S_CODEGEN} should exists.\nAdd k8s.io/code-generator to go.mod and run go mod download" > /dev/stderr | ||
- exit 1 | ||
status: | ||
- | | ||
ls $K8S_CODEGEN && find $K8S_CODEGEN -name \*.sh -exec chmod +x {} \; | ||
_ensure:k8s-kube-openapi: | ||
desc: "Ensure k8s.io/kube-openapi" | ||
internal: true | ||
cmds: | ||
- go install -mod=readonly k8s.io/kube-openapi/cmd/openapi-gen | ||
status: | ||
- | | ||
ls $GOPATH/bin/openapi-gen |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.