cleanup & retained mode test for k8s and aws
parent
1e34c6f5d6
commit
ac53014e71
|
|
@ -1607,7 +1607,9 @@ class AWSTaskRunner {
|
|||
}
|
||||
const { output, shouldCleanup } = yield this.streamLogsUntilTaskStops(cluster, taskArn, streamName);
|
||||
const taskData = yield AWSTaskRunner.describeTasks(cluster, taskArn);
|
||||
const exitCode = (_q = taskData.containers) === null || _q === void 0 ? void 0 : _q[0].exitCode;
|
||||
const containerState = (_q = taskData.containers) === null || _q === void 0 ? void 0 : _q[0];
|
||||
const exitCode = (containerState === null || containerState === void 0 ? void 0 : containerState.exitCode) || undefined;
|
||||
cloud_runner_logger_1.default.log(`Container State: ${JSON.stringify(containerState, undefined, 4)}`);
|
||||
const wasSuccessful = exitCode === 0 || (exitCode === undefined && taskData.lastStatus === 'RUNNING');
|
||||
if (wasSuccessful) {
|
||||
cloud_runner_logger_1.default.log(`Cloud runner job has finished successfully`);
|
||||
|
|
@ -2464,6 +2466,7 @@ class AWSBuildEnvironment {
|
|||
return output;
|
||||
}
|
||||
catch (error) {
|
||||
cloud_runner_logger_1.default.log(`error running task ${error}`);
|
||||
yield this.cleanupResources(CF, taskDef);
|
||||
throw error;
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -66,7 +66,9 @@ class AWSTaskRunner {
|
|||
}
|
||||
const { output, shouldCleanup } = await this.streamLogsUntilTaskStops(cluster, taskArn, streamName);
|
||||
const taskData = await AWSTaskRunner.describeTasks(cluster, taskArn);
|
||||
const exitCode = taskData.containers?.[0].exitCode;
|
||||
const containerState = taskData.containers?.[0];
|
||||
const exitCode = containerState?.exitCode || undefined;
|
||||
CloudRunnerLogger.log(`Container State: ${JSON.stringify(containerState, undefined, 4)}`);
|
||||
const wasSuccessful = exitCode === 0 || (exitCode === undefined && taskData.lastStatus === 'RUNNING');
|
||||
if (wasSuccessful) {
|
||||
CloudRunnerLogger.log(`Cloud runner job has finished successfully`);
|
||||
|
|
|
|||
|
|
@ -138,6 +138,7 @@ class AWSBuildEnvironment implements ProviderInterface {
|
|||
|
||||
return output;
|
||||
} catch (error) {
|
||||
CloudRunnerLogger.log(`error running task ${error}`);
|
||||
await this.cleanupResources(CF, taskDef);
|
||||
throw error;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue