feat: Add gcloud pipeline scripts and enhance k3s VM startup with additional checks and installations

This commit is contained in:
jon brookes 2025-09-30 14:36:44 +01:00
parent 31af97ced8
commit ff815fa82c
6 changed files with 138 additions and 4 deletions

22
gcloud/tf/scripts/run_tofu.sh Executable file
View file

@ -0,0 +1,22 @@
#!/usr/bin/env bash
if [[ -d ".terraform" && -f ".terraform.lock.hcl" ]]; then
echo "✅ Terraform already initialized"
# tofu init
else
echo "⚠️ Initializing Terraform..."
tofu init
fi
if [[ $? -ne 0 ]]; then
echo "❌ tofu init failed, please check the output above"
exit 1
fi
# tofu apply with auto-approve to make it non-interactive
tofu apply -auto-approve
if [[ $? -ne 0 ]]; then
echo "❌ tofu apply failed, please check the output above"
exit 1
fi