From 1ace52b2ab1f3c6a0711549fa343f9e3441cbad2 Mon Sep 17 00:00:00 2001 From: karti-ai <176560021+karti-ai@users.noreply.github.com> Date: Fri, 28 Aug 2026 16:47:20 -0700 Subject: [PATCH] Fix the rollback snapshot, which had never worked MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The snapshot path was single-quoted inside the ssh payload, so the remote shell never expanded the command substitution: every deploy wrote into one directory named after the un-expanded literal, and the second deploy died on 'File exists'. It looked correct for exactly as long as there had only ever been one deploy — which is the failure mode this repo keeps finding, and the reason deploy.sh smoke-tests the public hostname instead of trusting an exit code. Two real snapshots now exist on the host. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_019mt6sHQHEnEYrJZvoMCJSB --- deploy/deploy.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/deploy/deploy.sh b/deploy/deploy.sh index 577c1c3..dab9c3f 100755 --- a/deploy/deploy.sh +++ b/deploy/deploy.sh @@ -29,7 +29,13 @@ ssh "$HOST" "set -e [ \"\$free\" -ge 3 ] || { echo \"only \${free}G free on /\"; exit 1; } mkdir -p '$SNAPS' if [ -d '$ROOT' ] && [ -n \"\$(ls -A '$ROOT' 2>/dev/null)\" ]; then - cp -al '$ROOT' '$SNAPS/\$(date +%Y%m%d-%H%M%S)' + # Double quotes, not single. Inside single quotes the remote shell never + # expands the command substitution, so every deploy wrote into a single + # directory named after the un-expanded literal, and the SECOND deploy died + # on 'File exists'. It looked like it worked for exactly as long as there + # had only ever been one deploy. Note this comment is inside a + # double-quoted ssh payload: anything it names gets expanded too. + cp -al '$ROOT' \"$SNAPS/\$(date +%Y%m%d-%H%M%S)\" fi ls -1dt '$SNAPS'/*/ 2>/dev/null | tail -n +11 | xargs -r rm -rf"