mirror of
https://github.com/ahinko/home-ops
synced 2026-04-21 21:47:44 +00:00
21 lines
619 B
Bash
Executable file
21 lines
619 B
Bash
Executable file
#!/bin/bash
|
|
|
|
REPO_PATH=$(dirname "$(dirname "$(readlink -f "$0")")")
|
|
|
|
DOCKER_PATH="${REPO_PATH}/docker"
|
|
|
|
# Do a git pull to get all the latest changes
|
|
git -C "$REPO_PATH" pull
|
|
|
|
# Use hostname to determine which subfolder to use.
|
|
if [[ $HOSTNAME == *"atlas"* ]]; then
|
|
DOCKER_PATH="${DOCKER_PATH}/atlas"
|
|
fi
|
|
|
|
# Loop through each folder in the docker folder and call docker-compose to pull any updated
|
|
# images as well as build and deamonize.
|
|
for d in "$DOCKER_PATH"/*/ ; do
|
|
cd "$d" || exit
|
|
/usr/bin/docker-compose -f docker-compose.yaml pull
|
|
/usr/bin/docker-compose -f docker-compose.yaml up -d --build
|
|
done
|