revert
This commit is contained in:
parent
98eaecb45f
commit
231c87a00c
|
@ -8,13 +8,9 @@ source config/tools.sh
|
||||||
# Check that required tools are installed
|
# Check that required tools are installed
|
||||||
check_utilities
|
check_utilities
|
||||||
|
|
||||||
sudo apt install retry -y
|
|
||||||
|
|
||||||
SKIP_PULL=0
|
SKIP_PULL=0
|
||||||
DEBUG=0
|
DEBUG=0
|
||||||
|
|
||||||
max_retries=10
|
|
||||||
|
|
||||||
for i in "$@"; do
|
for i in "$@"; do
|
||||||
case $i in
|
case $i in
|
||||||
--no-pull)
|
--no-pull)
|
||||||
|
@ -74,7 +70,7 @@ fi
|
||||||
|
|
||||||
echo "[$0] ***** Checking configuration... *****"
|
echo "[$0] ***** Checking configuration... *****"
|
||||||
|
|
||||||
retry --max-retries $max_retries -- yq eval -o json config.yaml > config.json
|
yq eval -o json config.yaml > config.json
|
||||||
|
|
||||||
if [[ ${CHECK_FOR_OUTDATED_CONFIG} == true ]]; then
|
if [[ ${CHECK_FOR_OUTDATED_CONFIG} == true ]]; then
|
||||||
nb_services=$(cat config.json | jq '.services | length')
|
nb_services=$(cat config.json | jq '.services | length')
|
||||||
|
@ -105,7 +101,6 @@ if [[ $(cat config.json | jq '[.services[] | select(.name=="flood" and .enabled=
|
||||||
echo "[$0] ******* Exiting *******"
|
echo "[$0] ******* Exiting *******"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Determine deluge hostname (for flood) based on the VPN status (enabled or not) of deluge
|
# Determine deluge hostname (for flood) based on the VPN status (enabled or not) of deluge
|
||||||
if [[ $(cat config.json | jq '[.services[] | select(.name=="deluge" and .enabled==true and .vpn==true)] | length') -eq 1 ]]; then
|
if [[ $(cat config.json | jq '[.services[] | select(.name=="deluge" and .enabled==true and .vpn==true)] | length') -eq 1 ]]; then
|
||||||
export DELUGE_HOST="gluetun"
|
export DELUGE_HOST="gluetun"
|
||||||
|
@ -286,20 +281,16 @@ echo "[$0] ***** Config OK. Launching services... *****"
|
||||||
|
|
||||||
if [[ "${SKIP_PULL}" != "1" ]]; then
|
if [[ "${SKIP_PULL}" != "1" ]]; then
|
||||||
echo "[$0] ***** Pulling all images... *****"
|
echo "[$0] ***** Pulling all images... *****"
|
||||||
|
${DOCKER_COMPOSE_BINARY} ${ALL_SERVICES} pull
|
||||||
retry --max-retries $max_retries -- ${DOCKER_COMPOSE_BINARY} ${ALL_SERVICES} pull
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "[$0] ***** Recreating containers if required... *****"
|
echo "[$0] ***** Recreating containers if required... *****"
|
||||||
|
${DOCKER_COMPOSE_BINARY} ${ALL_SERVICES} up -d --remove-orphans
|
||||||
retry --max-retries $max_retries -- ${DOCKER_COMPOSE_BINARY} ${ALL_SERVICES} up -d --remove-orphans
|
|
||||||
|
|
||||||
echo "[$0] ***** Done updating containers *****"
|
echo "[$0] ***** Done updating containers *****"
|
||||||
|
|
||||||
echo "[$0] ***** Clean unused images and volumes... *****"
|
echo "[$0] ***** Clean unused images and volumes... *****"
|
||||||
|
docker image prune -af
|
||||||
retry --max-retries $max_retries -- docker image prune -af
|
docker volume prune -f
|
||||||
retry --max-retries $max_retries -- docker volume prune -f
|
|
||||||
|
|
||||||
echo "[$0] ***** Done! *****"
|
echo "[$0] ***** Done! *****"
|
||||||
exit 0
|
exit 0
|
Loading…
Reference in New Issue