Caching cleanup
parent
a2de2cce34
commit
f47b8864a5
|
|
@ -72,6 +72,7 @@ function runMain() {
|
||||||
}
|
}
|
||||||
// Set output
|
// Set output
|
||||||
yield model_1.Output.setBuildVersion(buildParameters.buildVersion);
|
yield model_1.Output.setBuildVersion(buildParameters.buildVersion);
|
||||||
|
cloud_runner_logger_1.default.Shutdown();
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
|
|
@ -2624,7 +2625,7 @@ class CloudRunnerLogger {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CloudRunnerLogger.log(`STARTING INIT HOOK ${process.env.INIT_HOOK}`);
|
CloudRunnerLogger.log(`STARTING INIT HOOK ${process.env.INIT_HOOK}`);
|
||||||
const child = child_process_1.exec(process.env.INIT_HOOK, (error, stdout, stderr) => {
|
CloudRunnerLogger.child = child_process_1.exec(process.env.INIT_HOOK, (error, stdout, stderr) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
CloudRunnerLogger.error(`[GCP-LOGGER][ERROR]${error}`);
|
CloudRunnerLogger.error(`[GCP-LOGGER][ERROR]${error}`);
|
||||||
return;
|
return;
|
||||||
|
|
@ -2635,13 +2636,16 @@ class CloudRunnerLogger {
|
||||||
}
|
}
|
||||||
CloudRunnerLogger.log(`[GCP-LOGGER]${stdout}`);
|
CloudRunnerLogger.log(`[GCP-LOGGER]${stdout}`);
|
||||||
});
|
});
|
||||||
child.on('close', function (code) {
|
CloudRunnerLogger.child.on('close', function (code) {
|
||||||
CloudRunnerLogger.log(`[GCP-LOGGER][Exit code ${code}]`);
|
CloudRunnerLogger.log(`[GCP-LOGGER][Exit code ${code}]`);
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
throw new Error(`${code}`);
|
throw new Error(`${code}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
static Shutdown() {
|
||||||
|
CloudRunnerLogger.child.kill(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
exports.default = CloudRunnerLogger;
|
exports.default = CloudRunnerLogger;
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -27,6 +27,7 @@ async function runMain() {
|
||||||
|
|
||||||
// Set output
|
// Set output
|
||||||
await Output.setBuildVersion(buildParameters.buildVersion);
|
await Output.setBuildVersion(buildParameters.buildVersion);
|
||||||
|
CloudRunnerLogger.Shutdown();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed((error as Error).message);
|
core.setFailed((error as Error).message);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import { exec } from 'child_process';
|
import { ChildProcess, exec } from 'child_process';
|
||||||
import { Input } from '../..';
|
import { Input } from '../..';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
|
|
||||||
|
|
@ -56,7 +56,7 @@ class CloudRunnerLogger {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CloudRunnerLogger.log(`STARTING INIT HOOK ${process.env.INIT_HOOK}`);
|
CloudRunnerLogger.log(`STARTING INIT HOOK ${process.env.INIT_HOOK}`);
|
||||||
const child = exec(process.env.INIT_HOOK, (error: any, stdout: string, stderr: any) => {
|
CloudRunnerLogger.child = exec(process.env.INIT_HOOK, (error: any, stdout: string, stderr: any) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
CloudRunnerLogger.error(`[GCP-LOGGER][ERROR]${error}`);
|
CloudRunnerLogger.error(`[GCP-LOGGER][ERROR]${error}`);
|
||||||
return;
|
return;
|
||||||
|
|
@ -67,12 +67,16 @@ class CloudRunnerLogger {
|
||||||
}
|
}
|
||||||
CloudRunnerLogger.log(`[GCP-LOGGER]${stdout}`);
|
CloudRunnerLogger.log(`[GCP-LOGGER]${stdout}`);
|
||||||
});
|
});
|
||||||
child.on('close', function (code) {
|
CloudRunnerLogger.child.on('close', function (code) {
|
||||||
CloudRunnerLogger.log(`[GCP-LOGGER][Exit code ${code}]`);
|
CloudRunnerLogger.log(`[GCP-LOGGER][Exit code ${code}]`);
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
throw new Error(`${code}`);
|
throw new Error(`${code}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
public static Shutdown() {
|
||||||
|
CloudRunnerLogger.child.kill(0);
|
||||||
|
}
|
||||||
|
private static child: ChildProcess;
|
||||||
}
|
}
|
||||||
export default CloudRunnerLogger;
|
export default CloudRunnerLogger;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue