diff options
author | EuAndreh <eu@euandre.org> | 2019-05-28 20:10:21 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2019-05-28 20:10:21 -0300 |
commit | 0880d9f6761df47ae3b5bfde7a626033bc6539eb (patch) | |
tree | f99e2a32c3b866ac066236aea422c618404ee5d6 /scripts/ci | |
parent | Store plan file in vps-state too (diff) | |
download | server-0880d9f6761df47ae3b5bfde7a626033bc6539eb.tar.gz server-0880d9f6761df47ae3b5bfde7a626033bc6539eb.tar.xz |
Fix mixed usage of $PLAN_FILE variable
Split $PLAN_FILE into $PLAN_FILE_NAME and $PLAN_FILE_PATH.
Diffstat (limited to 'scripts/ci')
-rwxr-xr-x | scripts/ci/provision.sh | 9 |
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..." |