aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2019-06-10 17:41:28 -0300
committerEuAndreh <eu@euandre.org>2019-06-10 17:41:28 -0300
commitb6a2d6b1aefade06771c9932aa52c842a8e61b03 (patch)
tree0909b59f6c66267f46226c5af4939def2cc9c734 /scripts
parentCommit public key instead of downloading it (diff)
downloadserver-b6a2d6b1aefade06771c9932aa52c842a8e61b03.tar.gz
server-b6a2d6b1aefade06771c9932aa52c842a8e61b03.tar.xz
Put terraform output in email logs.txt
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/ci/provision.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/ci/provision.sh b/scripts/ci/provision.sh
index b86e043..a17d7cc 100755
--- a/scripts/ci/provision.sh
+++ b/scripts/ci/provision.sh
@@ -48,7 +48,7 @@ echo "Done."
if [[ "${DESTROY_VOLUME:-}" != "" ]]; then
echo "Destroying existing infrastructure..."
- terraform destroy -input=false -auto-approve
+ terraform destroy -input=false -auto-approve ./logs/terraform-destroy.txt 2>&1
else
echo "Skipping explicit intentional destruction of existing infrastructure..."
fi
@@ -58,7 +58,7 @@ echo "Running 'terraform plan' and storing the planfile..."
mkdir -p "../vps-state/secrets/plan-files/"
PLAN_FILE_NAME="$(date -Iseconds)-$VPS_COMMIT_SHA.tfplan"
PLAN_FILE_PATH="../vps-state/secrets/plan-files/$PLAN_FILE_NAME"
-terraform plan -input=false -out="$PLAN_FILE_PATH"
+terraform plan -input=false -out="$PLAN_FILE_PATH" > ./logs/terraform-plan.txt 2>&1
pushd ../vps-state/
git add "secrets/plan-files/$PLAN_FILE_NAME"
git commit -m "CI: add .tfplan plan file for CI run $VPS_COMMIT_SHA"
@@ -67,7 +67,7 @@ popd
echo "Done."
echo "Running 'terraform apply'..."
-terraform apply -input=false -auto-approve "$PLAN_FILE_PATH"
+terraform apply -input=false -auto-approve "$PLAN_FILE_PATH" > ./logs/terraform-apply.txt 2>&1
echo "Done."
echo "Storing .tfstate file..."