[Update] Allow to skip fetching docker-compose
parent
f30026a85d
commit
f6a41daffa
19
update.sh
19
update.sh
|
@ -150,12 +150,17 @@ while (($#)); do
|
|||
echo -e "\e[32mForcing Update...\e[0m"
|
||||
FORCE=y
|
||||
;;
|
||||
--no-update-compose)
|
||||
NO_UPDATE_COMPOSE=y
|
||||
;;
|
||||
--help|-h)
|
||||
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)
|
||||
--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
|
||||
--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
|
||||
-f|--force - Force update, do not ask questions
|
||||
'
|
||||
|
@ -467,12 +472,15 @@ elif [[ ${MERGE_RETURN} != 0 ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
echo -e "\e[32mFetching new docker-compose version...\e[0m"
|
||||
sleep 2
|
||||
if [[ ! -z $(which pip) && $(pip list --local 2>&1 | grep -v DEPRECATION | grep -c docker-compose) == 1 ]]; then
|
||||
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"
|
||||
sleep 1
|
||||
if [[ ! -z $(which pip) && $(pip list --local 2>&1 | grep -v DEPRECATION | grep -c docker-compose) == 1 ]]; then
|
||||
true
|
||||
#prevent breaking a working docker-compose installed with pip
|
||||
elif [[ $(curl -sL -w "%{http_code}" https://www.servercow.de/docker-compose/latest.php -o /dev/null) == "200" ]]; then
|
||||
elif [[ $(curl -sL -w "%{http_code}" https://www.servercow.de/docker-compose/latest.php -o /dev/null) == "200" ]]; then
|
||||
LATEST_COMPOSE=$(curl -#L https://www.servercow.de/docker-compose/latest.php)
|
||||
COMPOSE_VERSION=$(docker-compose version --short)
|
||||
if [[ "$LATEST_COMPOSE" != "$COMPOSE_VERSION" ]]; then
|
||||
|
@ -484,8 +492,9 @@ elif [[ $(curl -sL -w "%{http_code}" https://www.servercow.de/docker-compose/lat
|
|||
echo -e "\e[33mWARNING: $COMPOSE_PATH is not writable, but new version $LATEST_COMPOSE is available (installed: $COMPOSE_VERSION)\e[0m"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
else
|
||||
echo -e "\e[33mCannot determine latest docker-compose version, skipping...\e[0m"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo -e "\e[32mFetching new images, if any...\e[0m"
|
||||
|
|
Loading…
Reference in New Issue