terraform: Download for Macos, increase mem
This commit is contained in:
parent
af1d217b33
commit
f9687c6773
2 changed files with 43 additions and 9 deletions
|
@ -30,12 +30,12 @@ FLUX_FORCE_LOCAL=1
|
|||
readonly FLUX_FORCE_LOCAL
|
||||
TF_VERSION="1.6.6"
|
||||
readonly TF_VERSION
|
||||
TF_ARCHIVE="terraform_${TF_VERSION}_linux_amd64.zip"
|
||||
readonly TF_ARCHIVE
|
||||
TF_ARCHIVE_LINUX="terraform_${TF_VERSION}_linux_amd64.zip"
|
||||
readonly TF_ARCHIVE_LINUX
|
||||
TF_ARCHIVE_MACOS="terraform_${TF_VERSION}_darwin_arm64.zip"
|
||||
readonly TF_ARCHIVE_MACOS
|
||||
TF_CHECKSUM=""
|
||||
readonly TF_CHECKSUM
|
||||
TF_URL="https://releases.hashicorp.com/terraform/${TF_VERSION}/${TF_ARCHIVE}"
|
||||
readonly TF_URL
|
||||
TF_FORCE_LOCAL=1
|
||||
readonly TF_FORCE_LOCAL
|
||||
OS="Linux"
|
||||
|
@ -55,9 +55,13 @@ printf "Running on ${OS}\n"
|
|||
if [[ "$OS" = "macos" ]]; then
|
||||
FLUX_URL="${FLUX_URL_MACOS}"
|
||||
FLUX_ARCHIVE="${FLUX_ARCHIVE_MACOS}"
|
||||
TF_ARCHIVE="${TF_ARCHIVE_MACOS}"
|
||||
TF_URL="https://releases.hashicorp.com/terraform/${TF_VERSION}/${TF_ARCHIVE}"
|
||||
else
|
||||
FLUX_URL="${FLUX_URL_LINUX}"
|
||||
FLUX_ARCHIVE="${FLUX_ARCHIVE_MACOS}"
|
||||
FLUX_ARCHIVE="${FLUX_ARCHIVE_LINUX}"
|
||||
TF_ARCHIVE="${TF_ARCHIVE_LINUX}"
|
||||
TF_URL="https://releases.hashicorp.com/terraform/${TF_VERSION}/${TF_ARCHIVE}"
|
||||
fi
|
||||
|
||||
# We prefer podman but Ubuntu's podman is too old
|
||||
|
@ -67,7 +71,11 @@ fi
|
|||
|
||||
# Start minikube
|
||||
if ! $(minikube status | grep Nonexistent\|Stopped); then
|
||||
printf 'minikube is not running\nStarting minikube..'
|
||||
printf 'minikube is not running\nStarting minikube..\n'
|
||||
# Increase memory from default 2G
|
||||
podman machine set --memory=4096
|
||||
podman machine start
|
||||
minikube config set memory 3800
|
||||
if [[ 0 == "${VERBOSE}" ]]; then
|
||||
minikube start --driver="${minikube_driver}"
|
||||
else
|
||||
|
@ -93,9 +101,13 @@ fi
|
|||
|
||||
# Install terraform if local version enforced
|
||||
if [[ "$TF_FORCE_LOCAL" = 1 ]]; then
|
||||
printf "Fetching terraform archive..\n"
|
||||
curl -LO "${TF_URL}"
|
||||
unzip "${TF_ARCHIVE}"
|
||||
if [[ -e "$TF_ARCHIVE}" ]]; then
|
||||
printf "terraform binary exists\n"
|
||||
else
|
||||
printf "Fetching terraform archive..\n"
|
||||
curl -LO "${TF_URL}"
|
||||
unzip -n "${TF_ARCHIVE}"
|
||||
fi
|
||||
TF_CMD="./terraform"
|
||||
else
|
||||
TF_CMD="terraform"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue