2
0
Эх сурвалжийг харах

[Update] Validate docker-compose stack config before updating

andryyy 5 жил өмнө
parent
commit
1098f2ec86
1 өөрчлөгдсөн 6 нэмэгдсэн , 0 устгасан
  1. 6 0
      update.sh

+ 6 - 0
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