Run git pull first in update.sh, not mid-script #48
+11
-3
@@ -14,6 +14,17 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cd "$(dirname "$0")/.."
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
|
# Must run before anything else touches a file this script itself reads
|
||||||
|
# (docker-compose.yml, .env.example, this script's own remaining lines) —
|
||||||
|
# a self-updating script isn't guaranteed atomic against its own file
|
||||||
|
# changing mid-run, so pulling later can execute a mix of old and new
|
||||||
|
# script/compose content in one pass. Bit us for real: old GID-resolution
|
||||||
|
# code ran, then this pulled in new var names docker-compose.yml now
|
||||||
|
# requires, and nothing re-ran the (now-current) resolution step for
|
||||||
|
# them — see issue #5's thread.
|
||||||
|
echo "==> git pull"
|
||||||
|
git pull --ff-only
|
||||||
|
|
||||||
[ -f .env ] || cp .env.example .env
|
[ -f .env ] || cp .env.example .env
|
||||||
|
|
||||||
# Handles all three cases: the KEY=value line is missing entirely (.env
|
# Handles all three cases: the KEY=value line is missing entirely (.env
|
||||||
@@ -81,9 +92,6 @@ else
|
|||||||
echo "HOST_RENDER_GID: no 'render' group on this host, set it manually if still blank."
|
echo "HOST_RENDER_GID: no 'render' group on this host, set it manually if still blank."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "==> git pull"
|
|
||||||
git pull --ff-only
|
|
||||||
|
|
||||||
echo "==> validating compose config"
|
echo "==> validating compose config"
|
||||||
docker compose config -q
|
docker compose config -q
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user