From 4a3e93f49f7381a30f37904e72951f52e09f2de5 Mon Sep 17 00:00:00 2001 From: Pierre Mavro Date: Tue, 24 Dec 2019 13:13:00 +0100 Subject: [PATCH] refactor(get): directly addding install.sh to index.html to avoid redirect --- index.html | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index 3ee214b7..c67ded1c 100644 --- a/index.html +++ b/index.html @@ -1,8 +1,22 @@ - - - - -redirect - - - +#!/usr/bin/env bash + +set -e +#set -x + +repo="Qovery/qovery-cli" +output_tgz="/tmp/qovery.tgz" +dest_binary="/usr/local/bin" +os=$(uname | tr '[:upper:]' '[:lower:]') + +echo "Downloading Qovery CLI archive..." + +latest_tag=$(curl --silent "https://api.github.com/repos/$repo/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') +version=$(echo $latest_tag | sed 's/^v//') + +curl -o $output_tgz -sOL "https://github.com/${repo}/releases/download/${latest_tag}/qovery-cli_${version}_${os}_amd64.tar.gz" + +echo "Uncompressing qovery binary in $dest_binary directory" +tar -xzf $output_tgz -C $dest_binary +rm -f $output_tgz + +echo -e "\nQovery CLI is installed, you can now use 'qovery' command line"