aboutsummaryrefslogtreecommitdiff
path: root/scripts/ci/provision.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/ci/provision.sh')
-rwxr-xr-xscripts/ci/provision.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/ci/provision.sh b/scripts/ci/provision.sh
index 4ae29e5..2941d03 100755
--- a/scripts/ci/provision.sh
+++ b/scripts/ci/provision.sh
@@ -18,19 +18,20 @@ echo "Running 'terraform plan' and storing the planfile..."
terraform --version
terraform init
mkdir -p "../vps-state/secrets/plan-files/"
-PLAN_FILE="../vps-state/secrets/plan-files/$(date -Iseconds)-$(git rev-parse HEAD).tfplan"
-terraform plan -input=false -out="$PLAN_FILE"
+PLAN_FILE_NAME="$(date -Iseconds)-$(git rev-parse HEAD).tfplan"
+PLAN_FILE_PATH="../vps-state/secrets/plan-files/$PLAN_FILE_NAME"
+terraform plan -input=false -out="$PLAN_FILE_PATH"
# Store on git repo
pushd ../vps-state/
-git add "secrets/plan-files/$PLAN_FILE"
+git add "secrets/plan-files/$PLAN_FILE_NAME"
git commit -m "CI: add .tfplan plan file for CI run $(git rev-parse HEAD)"
git push origin master
popd
echo "Done."
echo "Running 'terraform apply'..."
-terraform apply -input=false -auto-approve "$PLAN_FILE"
+terraform apply -input=false -auto-approve "$PLAN_FILE_PATH"
echo "Done."
echo "Storing .tfstate file..."