Fix the rollback snapshot, which had never worked
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) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019mt6sHQHEnEYrJZvoMCJSB
This commit is contained in:
+7
-1
@@ -29,7 +29,13 @@ ssh "$HOST" "set -e
|
|||||||
[ \"\$free\" -ge 3 ] || { echo \"only \${free}G free on /\"; exit 1; }
|
[ \"\$free\" -ge 3 ] || { echo \"only \${free}G free on /\"; exit 1; }
|
||||||
mkdir -p '$SNAPS'
|
mkdir -p '$SNAPS'
|
||||||
if [ -d '$ROOT' ] && [ -n \"\$(ls -A '$ROOT' 2>/dev/null)\" ]; then
|
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
|
fi
|
||||||
ls -1dt '$SNAPS'/*/ 2>/dev/null | tail -n +11 | xargs -r rm -rf"
|
ls -1dt '$SNAPS'/*/ 2>/dev/null | tail -n +11 | xargs -r rm -rf"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user