infrastructure/scripts/update.sh

25 lines
451 B
Bash
Raw Permalink Normal View History

2023-09-24 15:46:40 +03:00
#!/bin/bash
source /root/.bashrc
# Iterate through all folders in /opt
for FOLDER in /opt/*; do
2023-09-24 15:56:51 +03:00
if [ -d "$FOLDER" ]; then
echo "Processing folder: $FOLDER"
2023-09-24 15:46:40 +03:00
2023-09-24 15:56:51 +03:00
# Navigate into the folder
cd "$FOLDER" || continue
2023-09-24 15:46:40 +03:00
2023-09-24 15:56:51 +03:00
# Pull Docker Compose images
docker compose pull
2023-09-24 15:46:40 +03:00
2023-09-24 15:56:51 +03:00
# Bring up Docker Compose services in detached mode
docker compose up -d
2023-09-24 15:46:40 +03:00
2023-09-24 15:56:51 +03:00
# Return to the previous directory
cd -
fi
2023-09-24 15:46:40 +03:00
done
docker system prune -a -f