Claenup docker util scripts
This commit is contained in:
parent
ceca641e2f
commit
d2269de4ad
9 changed files with 23 additions and 41 deletions
5
ansible/roles/docker-cleanup/files/docker-utils/dc
Executable file
5
ansible/roles/docker-cleanup/files/docker-utils/dc
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
exec docker-compose -f "/opt/$1/docker-compose.yml" "${@:2}"
|
|
@ -3,5 +3,5 @@
|
|||
set -e
|
||||
|
||||
for compose_file in /opt/**/docker-compose.yml; do
|
||||
docker-compose -f $compose_file pull --parallel
|
||||
docker-compose -f "$compose_file" "$@"
|
||||
done
|
|
@ -1,13 +0,0 @@
|
|||
#!/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
|
12
ansible/roles/docker-cleanup/files/docker-utils/hard-restart-all
Executable file
12
ansible/roles/docker-cleanup/files/docker-utils/hard-restart-all
Executable file
|
@ -0,0 +1,12 @@
|
|||
#!/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
|
5
ansible/roles/docker-cleanup/files/docker-utils/occ
Executable file
5
ansible/roles/docker-cleanup/files/docker-utils/occ
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
exec docker-compose -f /opt/nextcloud/docker-compose.yml exec -u abc nextcloud php /config/www/nextcloud/occ "$@"
|
|
@ -1,5 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
docker-compose -f /opt/nextcloud/docker-compose.yml exec -u abc nextcloud php /config/www/nextcloud/occ $@
|
|
@ -1,11 +0,0 @@
|
|||
#!/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
|
|
@ -1,11 +0,0 @@
|
|||
#!/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
|
Loading…
Reference in a new issue