Skip to content
Permalink
Browse files

Remove krew.zip from release, add krew.exe (#339)

This patch removes krew.zip (previously used in krew.yaml as well as
windows installation instructions) and adds:

- krew.exe (to be used in first-time installation on windows)
- krew.exe.sha256 (checksum file)

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
  • Loading branch information...
ahmetb authored and k8s-ci-robot committed Sep 11, 2019
1 parent 9463c6c commit 0837beba03bb66a10a57bb9e2dc5d7270c185afb
Showing with 23 additions and 24 deletions.
  1. +3 −3 .travis.yml
  2. +5 −5 README.md
  3. +2 −2 hack/krew.yaml
  4. +11 −12 hack/make-release-artifacts.sh
  5. +2 −2 hack/make-release-notes.sh
@@ -34,10 +34,10 @@ deploy:
on:
tags: true
file:
- out/krew.yaml
- out/krew.tar.gz
- out/krew.tar.gz.sha256
- out/krew.zip
- out/krew.zip.sha256
- out/krew.yaml
- out/krew.exe
- out/krew.exe.sha256
api_key:
secure: t4a69ruCl15etso89c/GSone/gEvWnG6+w4q6NUhjViVaJJuIFDth1C1KxuF/wWW9r2R6zpGNj1uEhfXlc1VB1gGJnq/dkxW7iiVpjPFZUpBYJlK49esrytTGmlNuoKSlX4WTyXEgyH/zui8psJdeVhdDu4yCDrWdkb54gjyp7enluvPNxD40naGybeCNUfWLHvbCOQU4zPQIS2E2Sb7IPlup4LfcUDZYoGuGiBxN9nbU4GOk5gYB1jcQ2j2bDdWtEqp0T19auyWtv/gkU7Mn6Ebt+PG3OxBuyVbw2rq0eB7SeR/6lSrkj2TX4jiMsStNRE+W7Es3t+b8BSOLJcXfi7GA2iyDA70vZYS97bo8TCnezKr65O39ADtmgjVAx+eGOUhuOJj3d1Ft6yK7EILaYMq9zy90EyeMTcuqekFSUo8b1dnyP3fgkDyEyZ0YUiTlUUDkjJO+m+kMqoGH4FpkTgD+JmsXNTBzJ9PpRhP6d/Ti8OuwtjT7iEGmgp5aqPTti01vcxDK7xremNx5Vbqd7QHwFvOcJFPD9oF7rEMbFLpGfn61YHqefGnAxAItLmAOeMAH8A1j5xByB/4NsCukKJSJc3is0ClGL/d44BmeVtVrCM6/0lsCSOfyC5ph2f8o/yyC/26ShFsDyN6vB57VWTzXbUm3ybaT3GgRFTyC+Q=
@@ -94,15 +94,15 @@ Check out the list of [kubectl plugins available on krew][list] or just run
**Windows:**

1. Make sure `git` is installed on your system.
1. Download `krew.zip` and `krew.yaml` from the [Releases][releases] page.
1. Extract the `krew.zip` archive to a directory, navigate to the directory.
1. Launch a command-line window (`cmd.exe`) in that directory.
1. Download `krew.exe` and `krew.yaml` from the [Releases][releases] page to
a directory.
1. Launch a command-line window (`cmd.exe`) and navigate to that directory.
1. Run the following command to install krew (pass the correct
paths to `krew.yaml` and `krew.zip` below):

.\krew-windows_amd64.exe install --manifest=krew.yaml --archive=krew.zip
krew install --manifest=krew.yaml

1. Add `%USERPROFILE%\.krew\bin` to your `PATH` environment variable
1. Add `%USERPROFILE%\.krew\bin` directory to your `PATH` environment variable
([how?](https://java.com/en/download/help/path.xml))

[releases]: https://github.com/kubernetes-sigs/krew/releases
@@ -64,8 +64,8 @@ spec:
matchLabels:
os: linux
arch: arm
- uri: https://github.com/kubernetes-sigs/krew/releases/download/KREW_TAG/krew.zip
sha256: KREW_ZIP_CHECKSUM
- uri: https://github.com/kubernetes-sigs/krew/releases/download/KREW_TAG/krew.tar.gz
sha256: KREW_TAR_CHECKSUM
bin: krew.exe
files:
- from: ./krew-windows_amd64.exe
@@ -26,7 +26,12 @@ if [[ ! -d "${bin_dir}" ]]; then
fi

krew_tar_archive="krew.tar.gz"
krew_zip_archive="krew.zip"
krew_exe="krew.exe"

# create a out/krew.exe convenience copy
if [[ -x "./${bin_dir}/krew-windows_amd64.exe" ]]; then
cp -- "./${bin_dir}/krew-windows_amd64.exe" "./out/krew.exe"
fi

# consistent timestamps for files in bindir to ensure consistent checksums
while IFS= read -r -d $'\0' f; do
@@ -40,11 +45,6 @@ echo >&2 "Creating ${krew_tar_archive} archive."
cd "${bin_dir}"
GZIP=-n tar czvf "${SCRIPTDIR}/../out/${krew_tar_archive}" ./*
)
echo >&2 "Creating ${krew_zip_archive} archive."
(
cd "${bin_dir}"
zip -X -q --verbose "${SCRIPTDIR}/../out/${krew_zip_archive}" ./*
)

checksum_cmd="shasum -a 256"
if hash sha256sum 2>/dev/null; then
@@ -57,11 +57,11 @@ echo >&2 "${krew_tar_archive} checksum: ${tar_checksum}"
echo "${tar_checksum}" >"${tar_sumfile}"
echo >&2 "Written ${tar_sumfile}."

zip_sumfile="out/${krew_zip_archive}.sha256"
zip_checksum="$(eval "${checksum_cmd[@]}" "out/${krew_zip_archive}" | awk '{print $1;}')"
echo >&2 "${krew_zip_archive} checksum: ${zip_checksum}"
echo "${zip_checksum}" >"${zip_sumfile}"
echo >&2 "Written ${zip_sumfile}."
exe_sumfile="out/krew.exe.sha256"
exe_checksum="$(eval "${checksum_cmd[@]}" "out/${krew_exe}" | awk '{print $1;}')"
echo >&2 "${krew_exe} checksum: ${exe_checksum}"
echo "${exe_checksum}" >"${exe_sumfile}"
echo >&2 "Written ${tar_sumfile}."

# Copy and process krew manifest
git_describe="$(git describe --tags --dirty --always)"
@@ -72,7 +72,6 @@ if [[ ! "${git_describe}" =~ v.* ]]; then
fi
krew_version="${TAG_NAME:-$git_describe}"
cp ./hack/krew.yaml ./out/krew.yaml
sed -i "s/KREW_ZIP_CHECKSUM/${zip_checksum}/g" ./out/krew.yaml
sed -i "s/KREW_TAR_CHECKSUM/${tar_checksum}/g" ./out/krew.yaml
sed -i "s/KREW_TAG/${krew_version}/g" ./out/krew.yaml
echo >&2 "Written out/krew.yaml."
@@ -29,8 +29,8 @@ download_base="https://github.com/kubernetes-sigs/krew/releases/download"
download_assets=(
krew.tar.gz
krew.tar.gz.sha256
krew.zip
krew.zip.sha256
krew.exe
krew.exe.sha256
krew.yaml
)

0 comments on commit 0837beb

Please sign in to comment.
You can’t perform that action at this time.