infrastructure/ansible/roles/docker-cleanup/files/docker-utils/hard-restart-all

13 lines
336 B
Text
Raw Normal View History

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