debug(deploy): truncate _debug.txt per run for unambiguous diagnostics
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user