pantry/projects/krew.sigs.k8s.io/package.yml
uesyn d24d0dc3c0
krew (#3882)
* Add krew

* Add runtime dependencies

* remove redundant dep

---------

Co-authored-by: Jacob Heider <jacob@pkgx.dev>
2023-10-28 11:13:07 -04:00

43 lines
932 B
YAML

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