Add script to update containers
This is an attended update, which is better. Eventually replace watchtower
This commit is contained in:
parent
2c4e1e0414
commit
413ff4dad9
1 changed files with 13 additions and 0 deletions
13
ansible/roles/docker_cleanup/files/docker-utils/update-all
Executable file
13
ansible/roles/docker_cleanup/files/docker-utils/update-all
Executable 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
|
||||||
|
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
|
Loading…
Reference in a new issue