aboutsummaryrefslogtreecommitdiff
path: root/scripts/ci/deploy.sh
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2019-06-11 00:25:57 -0300
committerEuAndreh <eu@euandre.org>2019-06-11 00:25:57 -0300
commit244f67108423a1e60cc00ca4dab1a3e15a59f3ed (patch)
treedfc8e21b77a2092deb6be74547d080c775285a1b /scripts/ci/deploy.sh
parentDebug failing run of Ansible playbook (diff)
downloadtoph-244f67108423a1e60cc00ca4dab1a3e15a59f3ed.tar.gz
toph-244f67108423a1e60cc00ca4dab1a3e15a59f3ed.tar.xz
Log if trap was called on error or normal exit
Diffstat (limited to 'scripts/ci/deploy.sh')
-rwxr-xr-xscripts/ci/deploy.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/ci/deploy.sh b/scripts/ci/deploy.sh
index 244f869..6627e74 100755
--- a/scripts/ci/deploy.sh
+++ b/scripts/ci/deploy.sh
@@ -6,9 +6,17 @@ cd "$(dirname "${BASH_SOURCE[0]}")"
cd ../../
mail_debug_log() {
- local -r ec="${?}"
+ local -r exit_code="${?}"
+
+ if [[ "${exit_code}" = 0 ]]; then
+ echo "Finished successfully."
+ else
+ echo "TRAPPED ERROR!"
+ fi
+ echo "Running final steps..."
+
echo "Sending logs via email..."
- ./scripts/ci/mail.sh "${ec}"
+ ./scripts/ci/mail.sh "${exit_code}"
echo "Done."
echo "Storing file changes to '.tfstate' files..."