diff --git a/scripts/install_plugin.sh b/scripts/install_plugin.sh index 459a06a..9b09adb 100755 --- a/scripts/install_plugin.sh +++ b/scripts/install_plugin.sh @@ -1,4 +1,5 @@ #!/bin/sh -e +set -xe # Copied w/ love from the excellent hypnoglow/helm-s3 @@ -10,13 +11,23 @@ fi version="$(cat plugin.yaml | grep "version" | cut -d '"' -f 2)" echo "Downloading and installing helm-push v${version} ..." +arch="" url="" +if [ "$(arch)" = "aarch64" ]; then + arch="arm64" +elif [ "$(arch)" = "arm" ] ; then + arch="arm64" +else + arch="amd64" +fi + + if [ "$(uname)" = "Darwin" ]; then - url="https://github.com/vivid-money/helm-plugin-render-values/releases/download/v${version}/helm-plugin-render-values_${version}_darwin_amd64.tar.gz" + url="https://github.com/vivid-money/helm-plugin-render-values/releases/download/v${version}/helm-plugin-render-values_${version}_darwin_${arch}.tar.gz" elif [ "$(uname)" = "Linux" ] ; then - url="https://github.com/vivid-money/helm-plugin-render-values/releases/download/v${version}/helm-plugin-render-values_${version}_linux_amd64.tar.gz" + url="https://github.com/vivid-money/helm-plugin-render-values/releases/download/v${version}/helm-plugin-render-values_${version}_linux_${arch}.tar.gz" else - url="https://github.com/vivid-money/helm-plugin-render-values/releases/download/v${version}/helm-plugin-render-values_${version}_windows_amd64.tar.gz" + url="https://github.com/vivid-money/helm-plugin-render-values/releases/download/v${version}/helm-plugin-render-values_${version}_windows_${arch}.tar.gz" fi echo $url diff --git a/scripts/make-assets.sh b/scripts/make-assets.sh index b59ba22..ddbcdb8 100755 --- a/scripts/make-assets.sh +++ b/scripts/make-assets.sh @@ -4,16 +4,20 @@ VERSION="0.2.1" mkdir -p assets -OS_LIST="darwin -linux -windows +OS_LIST="darwin/arm64 +darwin/amd64 +linux/arm64 +linux/amd64 +windows/amd64 " -mkdir assets/plugin +mkdir -p assets/plugin cp plugin.yaml LICENSE assets/plugin/ -for OS in $(echo $OS_LIST) -do - env GOOS=${OS} go build -o assets/plugin/render-values . - tar -czf assets/helm-plugin-render-values_${VERSION}_${OS}_amd64.tar.gz -C assets/plugin . +for OS_ARCH in $(echo $OS_LIST) +do + OS=${OS_ARCH%/*} + ARCH=${OS_ARCH#*/} + env GOOS=${OS} GOARCH=${ARCH} go build -o assets/plugin/render-values . + tar -czf assets/helm-plugin-render-values_${VERSION}_${OS}_${ARCH}.tar.gz -C assets/plugin . done