aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bun.lock2
-rwxr-xr-xdeploy/post-receive15
2 files changed, 10 insertions, 7 deletions
diff --git a/bun.lock b/bun.lock
index 173d544..b71c015 100644
--- a/bun.lock
+++ b/bun.lock
@@ -1,5 +1,5 @@
{
- "lockfileVersion": 2,
+ "lockfileVersion": 1,
"configVersion": 1,
"workspaces": {
"": {
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; }