From 2f7eb4d19c26927e4342a5caf46467eef95b40e8 Mon Sep 17 00:00:00 2001 From: Adrian Stobbe Date: Tue, 24 Oct 2023 10:55:33 +0200 Subject: [PATCH] uncomment install script --- .../install-constellation.sh | 53 +++++++++---------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/cli/internal/terraform/terraform/constellation-cluster/install-constellation.sh b/cli/internal/terraform/terraform/constellation-cluster/install-constellation.sh index 36d9b1549c8..664770d08da 100755 --- a/cli/internal/terraform/terraform/constellation-cluster/install-constellation.sh +++ b/cli/internal/terraform/terraform/constellation-cluster/install-constellation.sh @@ -1,31 +1,30 @@ #!/bin/bash -alias constellation="./constellation" -#if ! command -v constellation &> /dev/null -#then -# OS=$(uname -s) -# ARCH=$(uname -m) +if ! command -v constellation &> /dev/null +then + OS=$(uname -s) + ARCH=$(uname -m) -# URL="" + URL="" -# if [[ "$OS" = "Darwin" ]]; then -# if [[ "$ARCH" = "arm64" ]]; then -# URL="https://github.com/edgelesssys/constellation/releases/latest/download/constellation-darwin-arm64" -# elif [[ "$ARCH" = "x86_64" ]]; then -# URL="https://github.com/edgelesssys/constellation/releases/latest/download/constellation-darwin-amd64" -# fi -# elif [[ "$OS" = "Linux" ]]; then -# if [[ "$ARCH" = "x86_64" ]]; then -# URL="https://github.com/edgelesssys/constellation/releases/latest/download/constellation-linux-amd64" -# elif [[ "$ARCH" = "arm64" ]]; then -# URL="https://github.com/edgelesssys/constellation/releases/latest/download/constellation-linux-arm64" -# fi -# fi + if [[ "$OS" = "Darwin" ]]; then + if [[ "$ARCH" = "arm64" ]]; then + URL="https://github.com/edgelesssys/constellation/releases/latest/download/constellation-darwin-arm64" + elif [[ "$ARCH" = "x86_64" ]]; then + URL="https://github.com/edgelesssys/constellation/releases/latest/download/constellation-darwin-amd64" + fi + elif [[ "$OS" = "Linux" ]]; then + if [[ "$ARCH" = "x86_64" ]]; then + URL="https://github.com/edgelesssys/constellation/releases/latest/download/constellation-linux-amd64" + elif [[ "$ARCH" = "arm64" ]]; then + URL="https://github.com/edgelesssys/constellation/releases/latest/download/constellation-linux-arm64" + fi + fi -# if [ -z "$URL" ]; then -# echo "Unsupported OS or architecture" -# exit 1 -# else -# curl -o constellation -LO $URL -# sudo install constellation /usr/local/bin/constellation -# fi -#fi + if [ -z "$URL" ]; then + echo "Unsupported OS or architecture" + exit 1 + else + curl -o constellation -LO $URL + sudo install constellation /usr/local/bin/constellation + fi +fi