9c0db746060f9397e91b7e8dfe602ab5030c0fe2 diff --git a/scripts/p620/deploy-tdd-md.sh b/scripts/p620/deploy-tdd-md.sh index 167c0e2fe9767dfb040510725064ba2a0307e9bd..e1394403b3a354fd4297fec0a91f22b28b62561a 100755 --- a/scripts/p620/deploy-tdd-md.sh +++ b/scripts/p620/deploy-tdd-md.sh @@ -138,17 +138,29 @@ else fi # --------------------------------------------------------------------- -# Snapshot git-history + tests — only meaningful in git mode (rsync -# mode already did this above against the local tree). +# Snapshot git-history + bundle sama-cli — only meaningful in git mode +# (rsync mode already did this above against the local tree). +# +# p620 itself has no bun on the host PATH; the canonical Bun runtime +# lives in the tdd-md image. Run the scripts via `podman run` on the +# existing image, mounting the working tree so the writes land where +# the build context expects them. Surfaces non-zero exits — these +# steps used to be `2>/dev/null || echo ⚠ skipped` which silently hid +# 12 days of stale `/reports/live` data. # --------------------------------------------------------------------- if [[ "$MODE" == "git" ]]; then - echo "→ snapshot git history (on $SSH_HOST) → content/git-history/" - ssh "$SSH_HOST" "cd ~/$REMOTE_SRC_DIR && bun scripts/p620/snapshot-git-history.ts" 2>/dev/null \ - || echo " ⚠ snapshot-git-history skipped (script may live outside the rsync exclude — non-fatal)" + image_present=$(ssh "$SSH_HOST" "podman image inspect $IMAGE_TAG >/dev/null 2>&1 && echo yes || echo no") + if [[ "$image_present" == "no" ]]; then + echo " ⚠ image $IMAGE_TAG not present yet — skipping snapshot+bundle (will run on the next deploy after first build)" + else + echo "→ snapshot git history via podman run → content/git-history/" + ssh "$SSH_HOST" "podman run --rm -v \$HOME/$REMOTE_SRC_DIR:/work:Z --workdir /work $IMAGE_TAG bun scripts/p620/snapshot-git-history.ts" \ + || { echo "✗ snapshot-git-history failed"; exit 1; } - echo "→ bundle sama CLI on $SSH_HOST" - ssh "$SSH_HOST" "cd ~/$REMOTE_SRC_DIR && bun build scripts/sama-cli.ts --target=bun --outfile=public/sama-cli >/dev/null && chmod +x public/sama-cli" 2>/dev/null \ - || echo " ⚠ sama-cli bundle skipped (non-fatal)" + echo "→ bundle sama CLI via podman run → public/sama-cli" + ssh "$SSH_HOST" "podman run --rm -v \$HOME/$REMOTE_SRC_DIR:/work:Z --workdir /work --entrypoint sh $IMAGE_TAG -c 'bun build scripts/sama-cli.ts --target=bun --outfile=public/sama-cli >/dev/null && chmod +x public/sama-cli'" \ + || { echo "✗ sama-cli bundle failed"; exit 1; } + fi fi echo "→ podman build $IMAGE_TAG op $SSH_HOST"