updated docker-compose-up-all.sh

added docker-stack-deploy-all.sh
This commit is contained in:
Samuel Philipp 2020-10-19 19:59:22 +02:00
parent af9cf6cd9a
commit 3350f559f7
2 changed files with 20 additions and 4 deletions

View file

@ -1,10 +1,14 @@
#!/bin/bash #!/bin/bash
for dir in */; do for dir in */; do
echo "pull $dir" service="${dir/\//}"
docker-compose -f "$dir/docker-compose.yml" pull if [ -f "$service/docker-compose.yml" ]; then
echo "up $dir" echo "pull $service"
docker-compose -f "$dir/docker-compose.yml" up --build --remove-orphans -d docker-compose -f "$service/docker-compose.yml" pull
echo "up $service"
docker-compose -f "$service/docker-compose.yml" up --build --remove-orphans -d
fi
done done
echo "cleanup docker"
docker system prune --all --volumes --force docker system prune --all --volumes --force

View file

@ -0,0 +1,12 @@
#!/bin/bash
for dir in */; do
service="${dir/\//}"
if [ -f "$service/docker-compose.yml" ]; then
echo "deploy $service"
docker stack deploy -c "$service/docker-compose.yml" "$service"
fi
done
echo "cleanup docker"
docker system prune --all --volumes --force