* Add krew

* Add runtime dependencies

* remove redundant dep

---------

Co-authored-by: Jacob Heider <jacob@pkgx.dev>
This commit is contained in:
uesyn 2023-10-29 00:13:07 +09:00 committed by GitHub
parent bc67c75290
commit d24d0dc3c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,42 @@
distributable:
url: git+https://github.com/kubernetes-sigs/krew
ref: v{{version}}
versions:
github: kubernetes-sigs/krew
dependencies:
git-scm.org: '*'
build:
dependencies:
go.dev: ^1.21
script: |
export KREW_ROOT=$(pwd)/.krew
export PATH=${PATH}:${KREW_ROOT}/bin
go build \
-tags netgo \
-mod readonly \
-ldflags "-w \
-X sigs.k8s.io/krew/internal/version.gitCommit=$(git rev-parse --short HEAD) \
-X sigs.k8s.io/krew/internal/version.gitTag={{version}}" \
-o "{{prefix}}/bin/kubectl-krew" \
./cmd/krew
env:
CGO_ENABLED: 0
provides:
- bin/kubectl-krew
test:
dependencies:
gnu.org/grep: '*'
kubernetes.io/kubectl: '*'
env:
KREW_ROOT: $PWD
PATH: ${KREW_ROOT}/bin:${PATH}
script: |
kubectl-krew version | grep GitTag | grep {{version}}
kubectl-krew update
kubectl-krew install ctx
kubectl-ctx