|
|
|
@ -78,16 +78,14 @@ verifySupported() {
|
|
|
|
|
# checkDesiredVersion checks if the desired version is available.
|
|
|
|
|
checkDesiredVersion() {
|
|
|
|
|
if [ "x$DESIRED_VERSION" == "x" ]; then
|
|
|
|
|
# FIXME(bacongobbler): hard code the desired version for the time being.
|
|
|
|
|
# A better fix would be to filter for Helm 2 release pages.
|
|
|
|
|
TAG="v2.16.1"
|
|
|
|
|
# Get tag from release URL
|
|
|
|
|
# local latest_release_url="https://github.com/helm/helm/releases/latest"
|
|
|
|
|
# if type "curl" > /dev/null; then
|
|
|
|
|
# TAG=$(curl -Ls -o /dev/null -w %{url_effective} $latest_release_url | grep -oE "[^/]+$" )
|
|
|
|
|
# elif type "wget" > /dev/null; then
|
|
|
|
|
# TAG=$(wget $latest_release_url --server-response -O /dev/null 2>&1 | awk '/^ Location: /{DEST=$2} END{ print DEST}' | grep -oE "[^/]+$")
|
|
|
|
|
# fi
|
|
|
|
|
local release_url="https://github.com/helm/helm/releases"
|
|
|
|
|
if type "curl" > /dev/null; then
|
|
|
|
|
|
|
|
|
|
TAG=$(curl -Ls $release_url | grep 'href="/helm/helm/releases/tag/v2.' | grep -v no-underline | head -n 1 | cut -d '"' -f 2 | awk '{n=split($NF,a,"/");print a[n]}' | awk 'a !~ $0{print}; {a=$0}')
|
|
|
|
|
elif type "wget" > /dev/null; then
|
|
|
|
|
TAG=$(wget $release_url -O - 2>&1 | grep 'href="/helm/helm/releases/tag/v2.' | grep -v no-underline | head -n 1 | cut -d '"' -f 2 | awk '{n=split($NF,a,"/");print a[n]}' | awk 'a !~ $0{print}; {a=$0}')
|
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
TAG=$DESIRED_VERSION
|
|
|
|
|
fi
|
|
|
|
|