docker-mirror/update

42 lines
833 B
Plaintext
Raw Normal View History

#!/bin/bash
set -e
if [[ $EUID -ne 0 ]]; then
echo Run as root!
exit 1
fi
./stop
if [ ! -d "./.git" ]; then
if [ "$(git rev-parse --is-inside-work-tree || true)" == "true" ]; then
echo "Please run this script in the main directory"
exit 1
fi
git init --initial-branch=main
2023-02-20 06:10:25 +00:00
git remote add origin https://git.itsmebravo.dev/bravo68web/docker-mirror
git fetch
git reset --hard origin/main
2022-11-27 00:05:26 +00:00
elif [ ! -f ./custom.diff ]; then
2022-11-27 00:01:43 +00:00
git pull || { echo "Git pull failed, please fix the issue at hand."; exit 1; }
else
2022-11-27 00:01:43 +00:00
git fetch
git reset --hard origin/main
git apply ./custom.diff
fi
if [ "$SELFUPDATE" != 1 ]; then
SELFUPDATE=1 ./update
fi
source .env
if [ "$USE_TUNNELS" != "true" ]; then
2023-01-15 07:16:59 +00:00
docker compose -f docker-compose.yml pull
else
2023-01-15 07:16:59 +00:00
docker compose -f docker-compose-tunnels.yml pull
fi
./run