Skip to content

Commit

Permalink
Remove krew.zip from release, add krew.exe (#339)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ahmetb authored and k8s-ci-robot committed Sep 11, 2019
1 parent 9463c6c commit 0837beb
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 24 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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=
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions hack/krew.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 11 additions & 12 deletions hack/make-release-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)"
Expand All @@ -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."
4 changes: 2 additions & 2 deletions hack/make-release-notes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down

0 comments on commit 0837beb

Please sign in to comment.