aboutsummaryrefslogtreecommitdiffstats
path: root/deploy
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-16 13:01:25 -0700
committerAdam Soltys <[email protected]>2026-10-16 13:01:25 -0700
commita62288e5886a45906426084e0b23ae57e5e3f5e9 (patch)
tree3e1884385893a31956560df2c495b5adb0e94ce0 /deploy
parent2fe542686dde91f424ecb019c2886e467e9aebd8 (diff)
downloadcoinosv3-server-a62288e5886a45906426084e0b23ae57e5e3f5e9.tar.gz
coinosv3-server-a62288e5886a45906426084e0b23ae57e5e3f5e9.zip
Lockfile from Bun 1.3.14; deploy into an ordinary clone
The lockfile was written by a newer Bun than the pinned image can read. The deploy hook now keeps its checkout as a normal clone of the deploy repo, because submodule commands need a working tree of their own. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'deploy')
-rwxr-xr-xdeploy/post-receive15
1 files changed, 9 insertions, 6 deletions
diff --git a/deploy/post-receive b/deploy/post-receive
index 78e4ba2..b6b0b29 100755
--- a/deploy/post-receive
+++ b/deploy/post-receive
@@ -17,13 +17,16 @@ while read -r oldrev newrev ref; do
[ "$ref" = refs/heads/prod ] || continue
{
echo "== $(date -u +%FT%TZ) deploy $newrev"
- mkdir -p "$CHECKOUT"
- git --git-dir="$BARE" --work-tree="$CHECKOUT" checkout -f "$newrev" || { echo "checkout failed"; exit 1; }
- cd "$CHECKOUT" || exit 1
+ # the checkout is an ordinary clone of this repo, so submodules work
+ unset GIT_DIR
+ [ -d "$CHECKOUT/.git" ] || git clone -q --no-checkout "$BARE" "$CHECKOUT" || { echo "clone failed"; exit 1; }
+ git -C "$CHECKOUT" fetch -q origin || { echo "fetch failed"; exit 1; }
+ git -C "$CHECKOUT" checkout -q -f --detach "$newrev" || { echo "checkout failed"; exit 1; }
# the pinned coinosv3 commit comes from the coinosv3 repo on this host
- env -u GIT_DIR git -C "$CHECKOUT" --git-dir="$BARE" --work-tree="$CHECKOUT" \
- -c submodule.coinosv3.url=/home/adam/coinosv3.git -c protocol.file.allow=always \
- submodule update --init --force || { echo "submodule update failed"; exit 1; }
+ git -C "$CHECKOUT" config submodule.coinosv3.url /home/adam/coinosv3.git
+ git -C "$CHECKOUT" -c protocol.file.allow=always submodule update --init --force -q \
+ || { echo "submodule update failed"; exit 1; }
+ cd "$CHECKOUT" || exit 1
docker run --rm -v "$CHECKOUT":/app -w /app oven/bun:1.3.14 bun install --frozen-lockfile --production \
|| { echo "bun install failed"; exit 1; }