Skip to content

Commit

Permalink
couple CLI version to the TF module
Browse files Browse the repository at this point in the history
  • Loading branch information
elchead committed Nov 6, 2023
1 parent 85a1caa commit 33cc07e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 21 deletions.
1 change: 1 addition & 0 deletions .github/workflows/e2e-test-tf-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ jobs:
terraform apply -var-file=terraform.tfvars -auto-approve
- name: Destroy Terraform Cluster
# outcome is part of the steps context (https://docs.github.com/en/actions/learn-github-actions/contexts#steps-context)
if: always() && steps.apply_terraform.outcome != 'skipped'
working-directory: ./terraform-module/${{ inputs.cloudProvider }}-constellation
run: |
Expand Down
4 changes: 4 additions & 0 deletions dev-docs/workflows/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ Releases should be performed using [the automated release pipeline](https://gith
git push origin ${working_branch}
```

### Update CLI version for Terraform module

Update the `version` inside `terraform/constellation-cluster/install-constellation.sh` to the new release.

### Patch release

1. `cherry-pick` (only) the required commits from `main`
Expand Down
40 changes: 19 additions & 21 deletions terraform/constellation-cluster/install-constellation.sh
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
#!/usr/bin/env bash
if [[ -f ./constellation ]]; then
if [[ -f ./constellation ]]; then # needed to allow using devbuilds
echo "constellation CLI is already available."
exit 0
fi

echo "Fetching constellation ${VERSION}"
OS=$(uname -s)
ARCH=$(uname -m)
VERSION="latest"
URL=""

if [[ ${OS} == "Darwin" ]]; then
if [[ ${ARCH} == "arm64" ]]; then
URL="https://github.com/edgelesssys/constellation/releases/${VERSION}/download/constellation-darwin-arm64"
elif [[ ${ARCH} == "x86_64" ]]; then
URL="https://github.com/edgelesssys/constellation/releases/${VERSION}/download/constellation-darwin-amd64"
version="v2.13.0"
os=$(uname -s)
arch=$(uname -m)
url=""
if [[ ${os} == "Darwin" ]]; then
if [[ ${arch} == "arm64" ]]; then
url="https://github.com/edgelesssys/constellation/releases/download/${version}/constellation-darwin-arm64"
elif [[ ${arch} == "x86_64" ]]; then
url="https://github.com/edgelesssys/constellation/releases/download/${version}/constellation-darwin-amd64"
fi
elif [[ ${OS} == "Linux" ]]; then
if [[ ${ARCH} == "x86_64" ]]; then
URL="https://github.com/edgelesssys/constellation/releases/${VERSION}/download/constellation-linux-amd64"
elif [[ ${ARCH} == "arm64" ]]; then
URL="https://github.com/edgelesssys/constellation/releases/${VERSION}/download/constellation-linux-arm64"
elif [[ ${os} == "Linux" ]]; then
if [[ ${arch} == "x86_64" ]]; then
url="https://github.com/edgelesssys/constellation/releases/download/${version}/constellation-linux-amd64"
elif [[ ${arch} == "arm64" ]]; then
url="https://github.com/edgelesssys/constellation/releases/download/${version}/constellation-linux-arm64"
fi
fi

if [[ -z ${URL} ]]; then
echo "OS \"${OS}\" and/or architecture \"${ARCH}\" is not supported."
echo "Fetching constellation ${version}"
if [[ -z ${url} ]]; then
echo "OS \"${os}\" and/or architecture \"${arch}\" is not supported."
exit 1
else
curl -o constellation -L "${URL}"
curl -o constellation -L "${url}"
chmod +x constellation
fi

0 comments on commit 33cc07e

Please sign in to comment.