11 lines
397 B
Bash
Executable file
11 lines
397 B
Bash
Executable file
#!/bin/bash
|
|
# Apply a previously generated plan. Never auto-approves in prod.
|
|
set -euo pipefail
|
|
ENV="${1:?Usage: apply.sh <staging|prod>}"
|
|
cd "$(dirname "$0")/../terraform/envs/$ENV"
|
|
if [ "$ENV" = "prod" ]; then
|
|
echo "[apply] WARNING: applying to PRODUCTION."
|
|
read -rp "Type 'yes' to continue: " confirm
|
|
[ "$confirm" = "yes" ] || { echo "Aborted."; exit 1; }
|
|
fi
|
|
terraform apply tfplan
|