infrastructure/ansible/roles/docker_cleanup/files/docker-utils/update-all

14 lines
376 B
Text
Raw Permalink Normal View History

#!/usr/bin/env bash
set -e
for compose_file in /opt/**/docker-compose.yml; do
if [[ $(docker-compose -f "$compose_file" ps -q) ]]; then
echo "> Updating $compose_file"
docker-compose -f "$compose_file" pull
docker-compose -f "$compose_file" up -d --remove-orphans
else
echo "> Skipping $compose_file as it's not running."
fi
done