Add kubebuilder

This commit is contained in:
uesyn 2023-10-27 19:04:26 +09:00 committed by Jacob Heider
parent 3f5f7ad521
commit 2221652623

View file

@ -0,0 +1,37 @@
distributable:
url: https://github.com/kubernetes-sigs/kubebuilder/archive/refs/tags/v{{version}}.tar.gz
strip-components: 1
versions:
github: kubernetes-sigs/kubebuilder
build:
dependencies:
go.dev: ^1.21
gnu.org/coreutils: '*'
script: |
go build -ldflags="$LDFLAGS" -o $BUILDLOC ./cmd
env:
CGO_ENABLED: 0
LDFLAGS:
- -X main.kubeBuilderVersion={{version}}
- -X main.goos=$(go env GOOS)
- -X main.goarch=$(go env GOARCH)
- -X main.gitCommit=pkgx
- -X main.buildDate=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
BUILDLOC: '{{prefix}}/bin/kubebuilder'
provides:
- bin/kubebuilder
test:
dependencies:
gnu.org/grep: '*'
go.dev: ^1.21
script: |
kubebuilder version | grep 'KubeBuilderVersion:"{{version}}"'
mkdir test
cd test
go mod init example.com
kubebuilder init --plugins go/v4 --project-version 3 --skip-go-version-check
go clean --modcache