diff --git a/docker-updater.sh b/docker-updater.sh index 585c6f6..fbf4ee6 100644 --- a/docker-updater.sh +++ b/docker-updater.sh @@ -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!"