Log stacks after cleanup

pull/289/head
Frostebite 2021-09-12 17:48:42 +01:00
parent 4ee780c5c8
commit fe560ca9a3
3 changed files with 22 additions and 20 deletions

33
dist/index.js vendored
View File

@ -402,25 +402,25 @@ class AWSBuildEnvironment {
});
}
getParameterTemplate(p1) {
return `
${p1}:
Type: String
Default: ''
return `
${p1}:
Type: String
Default: ''
`;
}
getSecretTemplate(p1) {
return `
${p1}Secret:
Type: AWS::SecretsManager::Secret
Properties:
Name: !Join [ "", [ '${p1}', !Ref BUILDID ] ]
SecretString: !Ref ${p1}
return `
${p1}Secret:
Type: AWS::SecretsManager::Secret
Properties:
Name: !Join [ "", [ '${p1}', !Ref BUILDID ] ]
SecretString: !Ref ${p1}
`;
}
getSecretDefinitionTemplate(p1, p2) {
return `
- Name: '${p1}'
ValueFrom: !Ref ${p2}Secret
return `
- Name: '${p1}'
ValueFrom: !Ref ${p2}Secret
`;
}
insertAtTemplate(template, insertionKey, insertion) {
@ -431,8 +431,8 @@ class AWSBuildEnvironment {
setupCloudFormations(CF, buildGuid, image, entrypoint, commands, mountdir, workingdir, secrets) {
return __awaiter(this, void 0, void 0, function* () {
const logGuid = nanoid_1.customAlphabet(cloud_runner_constants_1.default.alphabet, 9)();
commands[1] += `
echo "${logGuid}"
commands[1] += `
echo "${logGuid}"
`;
yield this.setupBaseStack(CF);
const taskDefStackName = `${this.baseStackName}-${buildGuid}`;
@ -647,10 +647,11 @@ class AWSBuildEnvironment {
yield CF.waitFor('stackDeleteComplete', {
StackName: taskDef.taskDefStackName,
}).promise();
// Currently too slow and causes too much waiting
yield CF.waitFor('stackDeleteComplete', {
StackName: taskDef.taskDefStackNameTTL,
}).promise();
const stacks = yield CF.listStacks().promise();
core.info(`Stacks: ${JSON.stringify(stacks, undefined, 4)}`);
core.info('Cleanup complete');
});
}

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -358,7 +358,6 @@ class AWSBuildEnvironment implements CloudRunnerProviderInterface {
await CF.deleteStack({
StackName: taskDef.taskDefStackName,
}).promise();
await CF.deleteStack({
StackName: taskDef.taskDefStackNameTTL,
}).promise();
@ -366,12 +365,14 @@ class AWSBuildEnvironment implements CloudRunnerProviderInterface {
await CF.waitFor('stackDeleteComplete', {
StackName: taskDef.taskDefStackName,
}).promise();
// Currently too slow and causes too much waiting
await CF.waitFor('stackDeleteComplete', {
StackName: taskDef.taskDefStackNameTTL,
}).promise();
const stacks = await CF.listStacks().promise();
core.info(`Stacks: ${JSON.stringify(stacks, undefined, 4)}`);
core.info('Cleanup complete');
}
}