chore(deploy): remove _debug.txt on success; gitignore build output
This commit is contained in:
@@ -247,13 +247,21 @@ async function main() {
|
||||
|
||||
main()
|
||||
.then(async () => {
|
||||
// On success, keep diagnostics only briefly, then remove the debug file so
|
||||
// it is not left web-served at /userbase/_debug.txt. Failures keep it for
|
||||
// post-mortem (see .catch below).
|
||||
await flushDebug();
|
||||
try {
|
||||
if (HELPER_ID) await runExec(HELPER_ID, `rm -f ${HOST_STATIC}/_debug.txt`);
|
||||
} catch (e) {
|
||||
console.error('cleanup debug file failed:', e.message);
|
||||
}
|
||||
if (HELPER_ID) await dockerJson('DELETE', `/containers/${HELPER_ID}?force=true`);
|
||||
process.exit(0);
|
||||
})
|
||||
.catch(async (err) => {
|
||||
dbg('DEPLOY FAILED: ' + err.stack);
|
||||
await flushDebug();
|
||||
await flushDebug(); // keep debug file on failure for post-mortem
|
||||
if (HELPER_ID) await dockerJson('DELETE', `/containers/${HELPER_ID}?force=true`);
|
||||
console.error('DEPLOY FAILED:', err.message);
|
||||
process.exit(1);
|
||||
|
||||
Reference in New Issue
Block a user