Always describe AWS tasks for now, because unstable error handling

pull/352/head
Frostebite 2022-03-04 19:42:46 +00:00
parent 3d538c6395
commit d838bef87c
3 changed files with 11 additions and 9 deletions

3
dist/index.js vendored
View File

@ -1393,8 +1393,9 @@ class AWSTaskRunner {
const output = yield this.streamLogsUntilTaskStops(ECS, CF, taskDef, cluster, taskArn, streamName);
const exitCode = (_q = (yield AWSTaskRunner.describeTasks(ECS, cluster, taskArn)).containers) === null || _q === void 0 ? void 0 : _q[0].exitCode;
cloud_runner_logger_1.default.log(`Cloud runner job exit code ${exitCode}`);
cloud_runner_logger_1.default.log(`job failed with exit code ${exitCode} ${JSON.stringify(yield ECS.describeTasks({ tasks: [taskArn], cluster }).promise(), undefined, 4)}`);
if (exitCode !== 0 && exitCode !== undefined) {
core.error(`job failed with exit code ${exitCode} ${JSON.stringify(yield ECS.describeTasks({ tasks: [taskArn], cluster }).promise(), undefined, 4)}`);
core.error(`job failed with exit code ${exitCode} "exitCode !== 0 && exitCode !== undefined"`);
throw new Error(`job failed with exit code ${exitCode}`);
}
else {

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -75,14 +75,15 @@ class AWSTaskRunner {
const output = await this.streamLogsUntilTaskStops(ECS, CF, taskDef, cluster, taskArn, streamName);
const exitCode = (await AWSTaskRunner.describeTasks(ECS, cluster, taskArn)).containers?.[0].exitCode;
CloudRunnerLogger.log(`Cloud runner job exit code ${exitCode}`);
CloudRunnerLogger.log(
`job failed with exit code ${exitCode} ${JSON.stringify(
await ECS.describeTasks({ tasks: [taskArn], cluster }).promise(),
undefined,
4,
)}`,
);
if (exitCode !== 0 && exitCode !== undefined) {
core.error(
`job failed with exit code ${exitCode} ${JSON.stringify(
await ECS.describeTasks({ tasks: [taskArn], cluster }).promise(),
undefined,
4,
)}`,
);
core.error(`job failed with exit code ${exitCode} "exitCode !== 0 && exitCode !== undefined"`);
throw new Error(`job failed with exit code ${exitCode}`);
} else {
CloudRunnerLogger.log(`Cloud runner job has finished successfully`);