terraform: Download for Macos, increase mem

This commit is contained in:
Björn Busse 2024-02-15 17:23:57 +01:00
parent af1d217b33
commit f9687c6773
2 changed files with 43 additions and 9 deletions

View File

@ -0,0 +1,22 @@
apiVersion: spinnaker.io/v1alpha2
kind: SpinnakerService
metadata:
name: spinnaker
spec:
spinnakerConfig:
config:
version: 1.33.0
persistentStorage:
persistentStoreType: s3
# Spinnaker stores application and pipeline definitions here
# Create an S3 bucket and provide the name here
s3:
bucket: ob-spinnaker-artifacts-dev
rootFolder: front50
# spec.expose - This section defines how Spinnaker should be publicly exposed
expose:
# Kubernetes LoadBalancer type (service/ingress)
# Only "service" is supported for now
type: service
service:
type: LoadBalancer

View File

@ -30,12 +30,12 @@ FLUX_FORCE_LOCAL=1
readonly FLUX_FORCE_LOCAL readonly FLUX_FORCE_LOCAL
TF_VERSION="1.6.6" TF_VERSION="1.6.6"
readonly TF_VERSION readonly TF_VERSION
TF_ARCHIVE="terraform_${TF_VERSION}_linux_amd64.zip" TF_ARCHIVE_LINUX="terraform_${TF_VERSION}_linux_amd64.zip"
readonly TF_ARCHIVE readonly TF_ARCHIVE_LINUX
TF_ARCHIVE_MACOS="terraform_${TF_VERSION}_darwin_arm64.zip"
readonly TF_ARCHIVE_MACOS
TF_CHECKSUM="" TF_CHECKSUM=""
readonly TF_CHECKSUM readonly TF_CHECKSUM
TF_URL="https://releases.hashicorp.com/terraform/${TF_VERSION}/${TF_ARCHIVE}"
readonly TF_URL
TF_FORCE_LOCAL=1 TF_FORCE_LOCAL=1
readonly TF_FORCE_LOCAL readonly TF_FORCE_LOCAL
OS="Linux" OS="Linux"
@ -55,9 +55,13 @@ printf "Running on ${OS}\n"
if [[ "$OS" = "macos" ]]; then if [[ "$OS" = "macos" ]]; then
FLUX_URL="${FLUX_URL_MACOS}" FLUX_URL="${FLUX_URL_MACOS}"
FLUX_ARCHIVE="${FLUX_ARCHIVE_MACOS}" FLUX_ARCHIVE="${FLUX_ARCHIVE_MACOS}"
TF_ARCHIVE="${TF_ARCHIVE_MACOS}"
TF_URL="https://releases.hashicorp.com/terraform/${TF_VERSION}/${TF_ARCHIVE}"
else else
FLUX_URL="${FLUX_URL_LINUX}" 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 fi
# We prefer podman but Ubuntu's podman is too old # We prefer podman but Ubuntu's podman is too old
@ -67,7 +71,11 @@ fi
# Start minikube # Start minikube
if ! $(minikube status | grep Nonexistent\|Stopped); then 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 if [[ 0 == "${VERBOSE}" ]]; then
minikube start --driver="${minikube_driver}" minikube start --driver="${minikube_driver}"
else else
@ -93,9 +101,13 @@ fi
# Install terraform if local version enforced # Install terraform if local version enforced
if [[ "$TF_FORCE_LOCAL" = 1 ]]; then if [[ "$TF_FORCE_LOCAL" = 1 ]]; then
printf "Fetching terraform archive..\n" if [[ -e "$TF_ARCHIVE}" ]]; then
curl -LO "${TF_URL}" printf "terraform binary exists\n"
unzip "${TF_ARCHIVE}" else
printf "Fetching terraform archive..\n"
curl -LO "${TF_URL}"
unzip -n "${TF_ARCHIVE}"
fi
TF_CMD="./terraform" TF_CMD="./terraform"
else else
TF_CMD="terraform" TF_CMD="terraform"