diff options
-rw-r--r-- | TODOs.org | 3 | ||||
-rwxr-xr-x | scripts/ci/provision.sh | 8 |
2 files changed, 10 insertions, 1 deletions
@@ -143,7 +143,8 @@ Right now, secrets are scattered between the two repositories. By moving I can c ** TODO Run backup on Terraform destroy action instead of manually in =provision.sh= ** DONE Explicitly destroy Droplets before running Terraform apply CLOSED: [2019-06-05 Wed 19:48] -** NEXT Store updated =.tfstate= even in case of deployment failure +** DONE Store updated =.tfstate= even in case of deployment failure +CLOSED: [2019-06-10 Mon 21:21] Right now the script fails on Terraform commands before reaching git commands. I should trap the error, store on git and only then fail. ** DONE Fix alias in =bash-profile.sh= CLOSED: [2019-06-10 Mon 09:01] diff --git a/scripts/ci/provision.sh b/scripts/ci/provision.sh index 74f56f2..d96d854 100755 --- a/scripts/ci/provision.sh +++ b/scripts/ci/provision.sh @@ -14,6 +14,14 @@ mail_debug_log() { echo "Sending logs via email..." ./scripts/ci/mail.sh "${VPS_COMMIT_SHA}" "${ec}" echo "Done." + + echo "Storing file changes to '.tfstate' files..." + pushd ../vps-state/ + git add . + git commit -m "CI: fallback add all after provision.sh failure for CI run $VPS_COMMIT_SHA" ||: + git push origin master + popd + echo "Done." } trap mail_debug_log EXIT |