docker(install): print ha.stderr.log on failure

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2023-08-26 08:51:46 +02:00
parent 5b15c952e9
commit 4e8d894523

View File

@@ -155,7 +155,15 @@ export class Install {
[key: string]: string;
};
await core.group('Starting colima', async () => {
await Exec.exec('colima', ['start', '--very-verbose'], {env: envs});
try {
await Exec.exec('colima', ['start', '--very-verbose'], {env: envs});
} catch (e) {
const haStderrLog = path.join(os.homedir(), '.lima', 'colima', 'ha.stderr.log');
if (fs.existsSync(haStderrLog)) {
core.info(`Printing debug logs (${haStderrLog}):\n${fs.readFileSync(haStderrLog, {encoding: 'utf8'})}`);
}
throw e;
}
});
await core.group('Create Docker context', async () => {