[Update] Validate docker-compose stack config before updating

master
andryyy 2020-03-22 18:15:07 +01:00
parent e491b835e5
commit 1098f2ec86
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
1 changed files with 6 additions and 0 deletions

View File

@ -372,6 +372,12 @@ if [[ ! "$response" =~ ^([yY][eE][sS]|[yY])+$ ]]; then
exit 0 exit 0
fi 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_DIRECTORY=update_diffs
DIFF_FILE=${DIFF_DIRECTORY}/diff_before_update_$(date +"%Y-%m-%d-%H-%M-%S") DIFF_FILE=${DIFF_DIRECTORY}/diff_before_update_$(date +"%Y-%m-%d-%H-%M-%S")
mv diff_before_update* ${DIFF_DIRECTORY}/ 2> /dev/null mv diff_before_update* ${DIFF_DIRECTORY}/ 2> /dev/null