Fixing aws base stack setup error handling

pull/289/head
mdugdale 2021-08-22 01:15:02 +01:00
parent a0593807c4
commit f5e6599266
3 changed files with 69 additions and 59 deletions

6
dist/index.js vendored
View File

@ -580,6 +580,7 @@ class AWSBuildEnvironment {
const describeStack = () => __awaiter(this, void 0, void 0, function* () { const describeStack = () => __awaiter(this, void 0, void 0, function* () {
return yield CF.describeStacks(describeStackInput).promise(); return yield CF.describeStacks(describeStackInput).promise();
}); });
try {
if (!stackExists) { if (!stackExists) {
core.info(`${baseStackName} stack does not exist (${JSON.stringify(stacks)})`); core.info(`${baseStackName} stack does not exist (${JSON.stringify(stacks)})`);
yield CF.createStack(createStackInput).promise(); yield CF.createStack(createStackInput).promise();
@ -612,6 +613,11 @@ class AWSBuildEnvironment {
} }
} }
core.info('base stack is ready'); core.info('base stack is ready');
}
catch (error) {
core.error(JSON.stringify(yield describeStack(), undefined, 4));
throw error;
}
}); });
} }
handleStackCreationFailure(error, CF, taskDefStackName, taskDefCloudFormation, secrets) { handleStackCreationFailure(error, CF, taskDefStackName, taskDefCloudFormation, secrets) {

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -290,7 +290,7 @@ class AWSBuildEnvironment implements CloudRunnerProviderInterface {
const describeStack = async () => { const describeStack = async () => {
return await CF.describeStacks(describeStackInput).promise(); return await CF.describeStacks(describeStackInput).promise();
}; };
try {
if (!stackExists) { if (!stackExists) {
core.info(`${baseStackName} stack does not exist (${JSON.stringify(stacks)})`); core.info(`${baseStackName} stack does not exist (${JSON.stringify(stacks)})`);
await CF.createStack(createStackInput).promise(); await CF.createStack(createStackInput).promise();
@ -326,6 +326,10 @@ class AWSBuildEnvironment implements CloudRunnerProviderInterface {
} }
} }
core.info('base stack is ready'); core.info('base stack is ready');
} catch (error) {
core.error(JSON.stringify(await describeStack(), undefined, 4));
throw error;
}
} }
async handleStackCreationFailure( async handleStackCreationFailure(