Files
turnk8s/scripts/terraform/apply.sh
Armen Hakobian 56ffd639f3 fix/issue 24 merge pr (#26)
Containerized workflow stages
2024-10-04 12:33:25 +04:00

15 lines
328 B
Bash

#!/bin/bash
type=$1
clusters=( "${@:2}" )
for cluster in "${clusters[@]}"
do
export TF_VAR_cluster_name="$cluster"
workspace="${cluster#turnk8s-}-$type"
terraform workspace select -or-create "$workspace"
terraform validate -no-color
terraform plan -out="tfplan-$workspace"
terraform apply "tfplan-$workspace"
done