From 2221652623c95751e196abec27682f379bc1ae23 Mon Sep 17 00:00:00 2001 From: uesyn <17411645+uesyn@users.noreply.github.com> Date: Fri, 27 Oct 2023 19:04:26 +0900 Subject: [PATCH] Add kubebuilder --- projects/kubebuilder.io/package.yml | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 projects/kubebuilder.io/package.yml diff --git a/projects/kubebuilder.io/package.yml b/projects/kubebuilder.io/package.yml new file mode 100644 index 00000000..fc07bb1d --- /dev/null +++ b/projects/kubebuilder.io/package.yml @@ -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