fixing docker updater
All checks were successful
Check scripts syntax / check-scripts-syntax (push) Successful in 3s

This commit is contained in:
Jose Henrique 2024-12-28 22:07:04 -03:00
parent 84b0ce6cca
commit 00c4f5ceed

View File

@ -53,26 +53,33 @@ else
exit 1
fi
# Navigate on each folder and run docker-compose stop, pull and up -d
# Updating Docker containers
for folder in */; do
cd $folder
DOCKER_RUNNING=$(docker-compose ps -q)
# if .ignore file exists, skip the folder
if [ -f ".ignore" ]; then
echo -e "${LIGHT_BLUE}[$folder] Skipping docker container update"
cd ..
continue
fi
DOCKER_RUNNING=$(docker compose ps -q)
if [ -n "$DOCKER_RUNNING" ]; then
echo -e "${LIGHT_BLUE}[$folder] Stopping Docker containers"
docker-compose down > /dev/null
docker compose down > /dev/null
else
echo -e "${LIGHT_BLUE}[$folder] No Docker containers running"
fi
echo -e "${LIGHT_BLUE}[$folder] Updating images"
docker-compose pull > /dev/null
docker compose pull -q > /dev/null
if [ -n "$DOCKER_RUNNING" ]; then
echo -e "${LIGHT_BLUE}[$folder] Starting Docker containers"
docker-compose up -d > /dev/null
docker compose up -d > /dev/null
fi
echo -e "${LIGHT_GREEN}[$folder] Updated!"