Add some docker util scripts

This commit is contained in:
Jake Howard 2020-02-02 22:20:17 +00:00
parent 035ff0ac24
commit 7f1be920d6
Signed by: jake
GPG key ID: 57AFB45680EDD477
5 changed files with 49 additions and 0 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

View file

@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -e
for compose_file in /opt/**/docker-compose.yml; do
docker-compose -f $compose_file pull --parallel
done

View file

@ -0,0 +1,11 @@
#!/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 up -d
else
echo "> Skipping $compose_file as it's running."
fi
done

View file

@ -0,0 +1,11 @@
#!/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
else
echo "> Skipping $compose_file as it's not running."
fi
done

View file

@ -35,3 +35,10 @@
name: clean up docker containers
special_time: weekly
job: "docker system prune"
- name: Install util scripts
copy:
src: ./files/docker-utils
dest: "{{ home }}"
mode: 0755
directory_mode: 0755