This repository has been archived on 2023-09-23. You can view files and clone it, but cannot push or open issues or pull requests.
awesome-scripts/docker-compose-up-all.sh

26 lines
535 B
Bash

#!/bin/bash
for dir in */; do
service="${dir/\//}"
if [ -f "$service/docker-compose.yml" ]; then
cd "$service" || exit 1
if [ -f "pre-deploy.sh" ]; then
echo "pre deploy"
./pre-deploy.sh
fi
echo "pull $service"
docker compose pull
echo "up $service"
docker compose up --build --remove-orphans -d
if [ -f "post-deploy.sh" ]; then
sleep 30
echo "post deploy"
./post-deploy.sh
fi
cd ..
fi
done
echo "cleanup docker"
docker system prune --all --volumes --force