[Update] Allow to skip fetching docker-compose

This commit is contained in:
andryyy 2020-05-29 19:47:44 +02:00
parent f30026a85d
commit f6a41daffa
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF

View File

@ -150,12 +150,17 @@ while (($#)); do
echo -e "\e[32mForcing Update...\e[0m" echo -e "\e[32mForcing Update...\e[0m"
FORCE=y FORCE=y
;; ;;
--no-update-compose)
NO_UPDATE_COMPOSE=y
;;
--help|-h) --help|-h)
echo './update.sh [-c|--check, --ours, --gc, --skip-start, -h|--help] echo './update.sh [-c|--check, --ours, --gc, --skip-start, -h|--help]
-c|--check - Check for updates and exit (exit codes => 0: update available, 3: no updates) -c|--check - Check for updates and exit (exit codes => 0: update available, 3: no updates)
--ours - Use merge strategy "ours" to solve conflicts in favor of non-mailcow code (local changes) --ours - Use merge strategy "ours" to solve conflicts in favor of non-mailcow code (local changes)
--gc - Run garbage collector to delete old image tags --gc - Run garbage collector to delete old image tags
--no-update-compose - Do not update docker-compose
--prefetch - Only prefetch new images and exit (useful to prepare updates)
--skip-start - Do not start mailcow after update --skip-start - Do not start mailcow after update
-f|--force - Force update, do not ask questions -f|--force - Force update, do not ask questions
' '
@ -467,8 +472,11 @@ elif [[ ${MERGE_RETURN} != 0 ]]; then
exit 1 exit 1
fi fi
if [[ ${NO_UPDATE_COMPOSE} == "y" ]]; then
echo -e "\e[33mNot fetching latest docker-compose, please check for updates manually!\e[0m"
else
echo -e "\e[32mFetching new docker-compose version...\e[0m" echo -e "\e[32mFetching new docker-compose version...\e[0m"
sleep 2 sleep 1
if [[ ! -z $(which pip) && $(pip list --local 2>&1 | grep -v DEPRECATION | grep -c docker-compose) == 1 ]]; then if [[ ! -z $(which pip) && $(pip list --local 2>&1 | grep -v DEPRECATION | grep -c docker-compose) == 1 ]]; then
true true
#prevent breaking a working docker-compose installed with pip #prevent breaking a working docker-compose installed with pip
@ -487,6 +495,7 @@ elif [[ $(curl -sL -w "%{http_code}" https://www.servercow.de/docker-compose/lat
else else
echo -e "\e[33mCannot determine latest docker-compose version, skipping...\e[0m" echo -e "\e[33mCannot determine latest docker-compose version, skipping...\e[0m"
fi fi
fi
echo -e "\e[32mFetching new images, if any...\e[0m" echo -e "\e[32mFetching new images, if any...\e[0m"
sleep 2 sleep 2