From 1098f2ec868a4a252392b69ea7ed70a07e832f07 Mon Sep 17 00:00:00 2001 From: andryyy Date: Sun, 22 Mar 2020 18:15:07 +0100 Subject: [PATCH] [Update] Validate docker-compose stack config before updating --- update.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/update.sh b/update.sh index 00be50da..481e8178 100755 --- a/update.sh +++ b/update.sh @@ -372,6 +372,12 @@ if [[ ! "$response" =~ ^([yY][eE][sS]|[yY])+$ ]]; then exit 0 fi +echo -e "\e[32mValidating docker-compose stack configuration...\e[0m" +if ! docker-compose config -q; then + echo -e "\e[31m\nOh no, something went wrong. Please check the error message above.\e[0m" + exit 1 +fi + DIFF_DIRECTORY=update_diffs DIFF_FILE=${DIFF_DIRECTORY}/diff_before_update_$(date +"%Y-%m-%d-%H-%M-%S") mv diff_before_update* ${DIFF_DIRECTORY}/ 2> /dev/null