From 4249c7f3cd457a292c0fea8bae989b06f6f3c910 Mon Sep 17 00:00:00 2001 From: chenxing Date: Tue, 4 Aug 2026 23:21:42 +0800 Subject: [PATCH] debug(deploy): truncate _debug.txt per run for unambiguous diagnostics --- scripts/deploy-via-docker.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/deploy-via-docker.js b/scripts/deploy-via-docker.js index cd478a5..41bec2b 100644 --- a/scripts/deploy-via-docker.js +++ b/scripts/deploy-via-docker.js @@ -179,6 +179,21 @@ async function main() { } dbg('helper started'); + // Truncate the host debug file so each run starts clean (job container itself + // cannot write here; use the helper we just started). + const trunc = await dockerJson('POST', `/containers/${HELPER_ID}/exec`, { + Cmd: ['sh', '-c', `rm -f ${HOST_STATIC}/_debug.txt`], + AttachStdin: false, + AttachStdout: false, + AttachStderr: false, + }); + if (trunc.status < 400) { + const tId = JSON.parse(trunc.body).Id; + await dockerJson('POST', `/exec/${tId}/start`, { Detach: true, Tty: false }); + await new Promise((r) => setTimeout(r, 200)); + } + dbg('debug file truncated for this run'); + // 2) locate the built assets inside THIS container. const jobId = getContainerId(); dbg('job container id=' + jobId);