Skip to content

Instantly share code, notes, and snippets.

@jbbarth
Created February 5, 2024 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbbarth/0356bdfa2e703a1f218c79731287200d to your computer and use it in GitHub Desktop.
Save jbbarth/0356bdfa2e703a1f218c79731287200d to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Copied from https://get.qovery.com/
# Adapted with https://github.com/Qovery/qovery-cli/issues/159 to support ARM
# Stored in the repo because we don't like to "curl | bash"
set -e
set +x
echo "##################################"
echo "# #"
echo "# QOVERY CLI INSTALL #"
echo "# #"
echo "##################################"
echo ""
repo="Qovery/qovery-cli"
output_tgz="/tmp/qovery.tgz"
dest_binary="/usr/local/bin"
os=$(uname | tr '[:upper:]' '[:lower:]')
if [ "$arch" = "x86_64" ]; then
arch="amd64"
else
arch="arm64"
fi
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//')
test -f $output_tgz && rm -f $output_tgz
curl -o $output_tgz -sOL "https://github.com/${repo}/releases/download/${latest_tag}/qovery-cli_${version}_${os}_${arch}.tar.gz"
echo "[+] Uncompressing qovery binary in $dest_binary directory (sudo permissions are required)"
sudo tar -xzf $output_tgz -C $dest_binary qovery
rm -f $output_tgz
echo -e "\nQovery CLI is installed, you can now use 'qovery' command line"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment