Extract docker cleanup stuff into its own role

This commit is contained in:
Jake Howard
2020-04-23 20:17:54 +01:00
parent 7a296c63a2
commit 9962d9103f
11 changed files with 7 additions and 7 deletions

View File

@ -0,0 +1,13 @@
#!/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