Always describe AWS tasks for now, because unstable error handling
parent
3d538c6395
commit
d838bef87c
|
|
@ -1393,8 +1393,9 @@ class AWSTaskRunner {
|
||||||
const output = yield this.streamLogsUntilTaskStops(ECS, CF, taskDef, cluster, taskArn, streamName);
|
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;
|
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(`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) {
|
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}`);
|
throw new Error(`job failed with exit code ${exitCode}`);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -75,14 +75,15 @@ class AWSTaskRunner {
|
||||||
const output = await this.streamLogsUntilTaskStops(ECS, CF, taskDef, cluster, taskArn, streamName);
|
const output = await this.streamLogsUntilTaskStops(ECS, CF, taskDef, cluster, taskArn, streamName);
|
||||||
const exitCode = (await AWSTaskRunner.describeTasks(ECS, cluster, taskArn)).containers?.[0].exitCode;
|
const exitCode = (await AWSTaskRunner.describeTasks(ECS, cluster, taskArn)).containers?.[0].exitCode;
|
||||||
CloudRunnerLogger.log(`Cloud runner job exit code ${exitCode}`);
|
CloudRunnerLogger.log(`Cloud runner job exit code ${exitCode}`);
|
||||||
if (exitCode !== 0 && exitCode !== undefined) {
|
CloudRunnerLogger.log(
|
||||||
core.error(
|
|
||||||
`job failed with exit code ${exitCode} ${JSON.stringify(
|
`job failed with exit code ${exitCode} ${JSON.stringify(
|
||||||
await ECS.describeTasks({ tasks: [taskArn], cluster }).promise(),
|
await ECS.describeTasks({ tasks: [taskArn], cluster }).promise(),
|
||||||
undefined,
|
undefined,
|
||||||
4,
|
4,
|
||||||
)}`,
|
)}`,
|
||||||
);
|
);
|
||||||
|
if (exitCode !== 0 && exitCode !== undefined) {
|
||||||
|
core.error(`job failed with exit code ${exitCode} "exitCode !== 0 && exitCode !== undefined"`);
|
||||||
throw new Error(`job failed with exit code ${exitCode}`);
|
throw new Error(`job failed with exit code ${exitCode}`);
|
||||||
} else {
|
} else {
|
||||||
CloudRunnerLogger.log(`Cloud runner job has finished successfully`);
|
CloudRunnerLogger.log(`Cloud runner job has finished successfully`);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue