clan-infra/targets/admins/tf.sh

14 lines
243 B
Bash
Raw Normal View History

2023-07-04 15:23:29 +00:00
#!/usr/bin/env bash
set -euo pipefail
rm -f .terraform.lock.hcl
if grep -q .sops terraform.tfstate; then
sops -i -d terraform.tfstate || true
fi
cleanup() {
sops -i -e terraform.tfstate
}
trap "cleanup" EXIT
terraform init
terraform "$@"