debug(deploy): truncate _debug.txt per run for unambiguous diagnostics

This commit is contained in:
chenxing
2026-08-04 23:21:42 +08:00
parent c2e7b8f12a
commit 4249c7f3cd
+15
View File
@@ -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);