From 244f67108423a1e60cc00ca4dab1a3e15a59f3ed Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Tue, 11 Jun 2019 00:25:57 -0300 Subject: Log if trap was called on error or normal exit --- scripts/ci/deploy.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'scripts/ci/deploy.sh') 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..." -- cgit v1.2.3