docker-scripts/docker-update-all

29 lines
564 B
Bash
Executable File

#!/bin/bash
if [ ! -z $1 ]; then
START_DIR="$1"
else
START_DIR="$HOME/docker-compose"
fi
if [ ! -d "$START_DIR" ]; then
echo "Invalid directory '$START_DIR': Exiting."
exit 1
fi
echo "Current dir is $START_DIR"
for f in $(find $START_DIR/ -iname "docker-compose.yml")
do
CURRENT_DIR=$(dirname "${f}")
echo "Updating $CURRENT_DIR..."
cd $CURRENT_DIR
if [ ! -f ".update.ignore" ]; then
docker-compose pull --no-parallel && docker-compose up -d --remove-orphans 2>&1
else
echo "Stack flagged for ignore updates"
fi
done
cd $START_DIR