25 lines
535 B
Bash
25 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
|