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