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);