From c38596f18d0f8c34edc6e30c2cb623b4b2783aeb Mon Sep 17 00:00:00 2001 From: Shane Starcher Date: Mon, 20 Apr 2020 11:43:30 -0700 Subject: [PATCH] unauthenticated github requests can get rate limited, fallback to using plugins.yaml --- install-binary.sh | 5 +++++ plugin.yaml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/install-binary.sh b/install-binary.sh index d9907d1..3e619f6 100755 --- a/install-binary.sh +++ b/install-binary.sh @@ -90,6 +90,11 @@ getDownloadURL() { elif type "wget" > /dev/null; then DOWNLOAD_URL=$(wget -q -O - $latest_url | awk '/\"browser_download_url\":/{gsub( /[,\"]/,"", $2); print $2}') fi + + if [ -z "$DOWNLOAD_URL" ]; then + VERSION="$(grep "version:" "$HELM_PLUGIN_DIR/plugin.yaml" | cut -d '"' -f 2)" + DOWNLOAD_URL="https://github.com/sstarcher/helm-release/releases/download/${VERSION}/helm-release_${VERSION}_${OS}_amd64.tar.gz" + fi } # downloadFile downloads the latest binary package and also the checksum diff --git a/plugin.yaml b/plugin.yaml index 65bc79d..bac921e 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -1,5 +1,5 @@ name: "release" -version: "0.3.0" +version: "0.3.2" usage: "Determines the charts next release number" description: |- This plugin will use environment variables and git history to divine the next chart version.