From 4ab7097d1dd0fb89eddc08477b5da59382b7056f Mon Sep 17 00:00:00 2001 From: "jbarrick@mesosphere.com" Date: Wed, 24 Jul 2019 15:59:48 -0700 Subject: [PATCH 1/6] Add script for generating a krew plugin manifest. --- hack/generate_krew.sh | 55 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 hack/generate_krew.sh diff --git a/hack/generate_krew.sh b/hack/generate_krew.sh new file mode 100755 index 000000000..038162995 --- /dev/null +++ b/hack/generate_krew.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +# This script generates a Krew-compatible plugin manifest. It should be run after goreleaser. + +VERSION=$(git describe --tags |sed 's/^v//g') + +# Generate the manifest for a single platform. +function generate_platform { + ARCH="${2}" + if [ "${2}" == "amd64" ]; then + ARCH=x86_64 + elif [ "${2}" == "386" ]; then + ARCH=i386 + fi + + cat <> kudo.yaml +apiVersion: krew.googlecontainertools.github.com/v1alpha2 +kind: Plugin +metadata: + name: kudo +spec: + version: "${VERSION}" + + shortDescription: KUDO CLI + homepage: https://kudo.dev/ + description: | + This plugin shows all environment variables that get injected when + launching a program as a plugin. You can use this field for longer + description and example usages. + + platforms: +EOF + +generate_platform linux amd64 >> kudo.yaml +generate_platform linux 386 >> kudo.yaml +generate_platform darwin amd64 >> kudo.yaml +generate_platform darwin 386 >> kudo.yaml +generate_platform windows amd64 >> kudo.yaml +generate_platform windows 386 >> kudo.yaml From 233a869498835ff29ebd7cf9aadaae0fbe2c2d95 Mon Sep 17 00:00:00 2001 From: "jbarrick@mesosphere.com" Date: Wed, 24 Jul 2019 16:03:18 -0700 Subject: [PATCH 2/6] Add note about making PR to krew --- hack/generate_krew.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hack/generate_krew.sh b/hack/generate_krew.sh index 038162995..1d0b8f711 100755 --- a/hack/generate_krew.sh +++ b/hack/generate_krew.sh @@ -53,3 +53,5 @@ generate_platform darwin amd64 >> kudo.yaml generate_platform darwin 386 >> kudo.yaml generate_platform windows amd64 >> kudo.yaml generate_platform windows 386 >> kudo.yaml + +echo "To publish to the krew index, create a pull request to https://github.com/kubernetes-sigs/krew-index/tree/master/plugins to update kudo.yaml with the newly generated kudo.yaml." From 5fd7b941f82741acc431b59620c660d6b76d879c Mon Sep 17 00:00:00 2001 From: "jbarrick@mesosphere.com" Date: Wed, 24 Jul 2019 16:05:12 -0700 Subject: [PATCH 3/6] improve plugin documentation --- hack/generate_krew.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hack/generate_krew.sh b/hack/generate_krew.sh index 1d0b8f711..b69a91fcf 100755 --- a/hack/generate_krew.sh +++ b/hack/generate_krew.sh @@ -40,9 +40,9 @@ spec: shortDescription: KUDO CLI homepage: https://kudo.dev/ description: | - This plugin shows all environment variables that get injected when - launching a program as a plugin. You can use this field for longer - description and example usages. + The Kubernetes Universal Declarative Operator (KUDO) is a highly productive toolkit for writing operators for Kubernetes. + Using KUDO, you can deploy your applications, give your users the tools they need to operate it, and understand how it's + behaving in their environments — all without a PhD in Kubernetes. platforms: EOF From b226daba7e3e714a73d2bf09cad5a971918b404a Mon Sep 17 00:00:00 2001 From: "jbarrick@mesosphere.com" Date: Wed, 24 Jul 2019 17:59:24 -0700 Subject: [PATCH 4/6] Fetch kudo plugin from github for hashing. --- hack/generate_krew.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/generate_krew.sh b/hack/generate_krew.sh index b69a91fcf..cc4aeb40b 100755 --- a/hack/generate_krew.sh +++ b/hack/generate_krew.sh @@ -2,7 +2,7 @@ # This script generates a Krew-compatible plugin manifest. It should be run after goreleaser. -VERSION=$(git describe --tags |sed 's/^v//g') +VERSION=${VERSION:-$(git describe --tags |sed 's/^v//g')} # Generate the manifest for a single platform. function generate_platform { @@ -19,7 +19,7 @@ function generate_platform { os: "${1}" arch: "${2}" uri: https://github.com/kudobuilder/kudo/releases/download/v${VERSION}/kudo_${VERSION}_${1}_${ARCH}.tar.gz - sha256: "$(sha256sum dist/kudo_${VERSION}_${1}_${ARCH}.tar.gz |awk '{print $1}')" + sha256: "$(curl -L https://github.com/kudobuilder/kudo/releases/download/v${VERSION}/kudo_${VERSION}_${1}_${ARCH}.tar.gz |sha256sum - |awk '{print $1}')" bin: "./kubectl-kudo" files: - from: "*" From 8c8b9d9b60589d79c6c33b7f9f17ed24d8976b66 Mon Sep 17 00:00:00 2001 From: "jbarrick@mesosphere.com" Date: Tue, 30 Jul 2019 10:44:09 -0700 Subject: [PATCH 5/6] Update shortDescription --- hack/generate_krew.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/generate_krew.sh b/hack/generate_krew.sh index cc4aeb40b..6d8652101 100755 --- a/hack/generate_krew.sh +++ b/hack/generate_krew.sh @@ -37,7 +37,7 @@ metadata: spec: version: "${VERSION}" - shortDescription: KUDO CLI + shortDescription: Declaratively build, install, and run operators using KUDO. homepage: https://kudo.dev/ description: | The Kubernetes Universal Declarative Operator (KUDO) is a highly productive toolkit for writing operators for Kubernetes. From c9a57479ca7ad3694ae8baa977436b0b4cef7ca1 Mon Sep 17 00:00:00 2001 From: "jbarrick@mesosphere.com" Date: Tue, 30 Jul 2019 10:46:56 -0700 Subject: [PATCH 6/6] Add generate_krew.sh to RELEASE.md documentation. --- RELEASE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE.md b/RELEASE.md index e14bccd0a..866737cb7 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -29,6 +29,7 @@ The official binaries for KUDO are created using [goreleaser](https://goreleaser 4. Invoke goreleaser `goreleaser --rm-dist`. 5. Update the GH release with Release high-levels. 6. An announcement email is sent to `kudobuilder@googlegroups.com` with the subject `[ANNOUNCE] Kudo $VERSION is released` +7. Run `./hack/generate_krew.sh` and submit the generated `kudo.yaml` to https://github.com/kubernetes-sigs/krew-index/. **Note:** If there are issues with the release, any changes to the repository will result in it being considered "dirty" and not in a state to be released. It is possible outside of the standard release process to build a "snapshot" release using the following command: `goreleaser release --skip-publish --snapshot --rm-dist`