Log stacks after cleanup
parent
4ee780c5c8
commit
fe560ca9a3
|
|
@ -402,25 +402,25 @@ class AWSBuildEnvironment {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
getParameterTemplate(p1) {
|
getParameterTemplate(p1) {
|
||||||
return `
|
return `
|
||||||
${p1}:
|
${p1}:
|
||||||
Type: String
|
Type: String
|
||||||
Default: ''
|
Default: ''
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
getSecretTemplate(p1) {
|
getSecretTemplate(p1) {
|
||||||
return `
|
return `
|
||||||
${p1}Secret:
|
${p1}Secret:
|
||||||
Type: AWS::SecretsManager::Secret
|
Type: AWS::SecretsManager::Secret
|
||||||
Properties:
|
Properties:
|
||||||
Name: !Join [ "", [ '${p1}', !Ref BUILDID ] ]
|
Name: !Join [ "", [ '${p1}', !Ref BUILDID ] ]
|
||||||
SecretString: !Ref ${p1}
|
SecretString: !Ref ${p1}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
getSecretDefinitionTemplate(p1, p2) {
|
getSecretDefinitionTemplate(p1, p2) {
|
||||||
return `
|
return `
|
||||||
- Name: '${p1}'
|
- Name: '${p1}'
|
||||||
ValueFrom: !Ref ${p2}Secret
|
ValueFrom: !Ref ${p2}Secret
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
insertAtTemplate(template, insertionKey, insertion) {
|
insertAtTemplate(template, insertionKey, insertion) {
|
||||||
|
|
@ -431,8 +431,8 @@ class AWSBuildEnvironment {
|
||||||
setupCloudFormations(CF, buildGuid, image, entrypoint, commands, mountdir, workingdir, secrets) {
|
setupCloudFormations(CF, buildGuid, image, entrypoint, commands, mountdir, workingdir, secrets) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const logGuid = nanoid_1.customAlphabet(cloud_runner_constants_1.default.alphabet, 9)();
|
const logGuid = nanoid_1.customAlphabet(cloud_runner_constants_1.default.alphabet, 9)();
|
||||||
commands[1] += `
|
commands[1] += `
|
||||||
echo "${logGuid}"
|
echo "${logGuid}"
|
||||||
`;
|
`;
|
||||||
yield this.setupBaseStack(CF);
|
yield this.setupBaseStack(CF);
|
||||||
const taskDefStackName = `${this.baseStackName}-${buildGuid}`;
|
const taskDefStackName = `${this.baseStackName}-${buildGuid}`;
|
||||||
|
|
@ -647,10 +647,11 @@ class AWSBuildEnvironment {
|
||||||
yield CF.waitFor('stackDeleteComplete', {
|
yield CF.waitFor('stackDeleteComplete', {
|
||||||
StackName: taskDef.taskDefStackName,
|
StackName: taskDef.taskDefStackName,
|
||||||
}).promise();
|
}).promise();
|
||||||
// Currently too slow and causes too much waiting
|
|
||||||
yield CF.waitFor('stackDeleteComplete', {
|
yield CF.waitFor('stackDeleteComplete', {
|
||||||
StackName: taskDef.taskDefStackNameTTL,
|
StackName: taskDef.taskDefStackNameTTL,
|
||||||
}).promise();
|
}).promise();
|
||||||
|
const stacks = yield CF.listStacks().promise();
|
||||||
|
core.info(`Stacks: ${JSON.stringify(stacks, undefined, 4)}`);
|
||||||
core.info('Cleanup complete');
|
core.info('Cleanup complete');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -358,7 +358,6 @@ class AWSBuildEnvironment implements CloudRunnerProviderInterface {
|
||||||
await CF.deleteStack({
|
await CF.deleteStack({
|
||||||
StackName: taskDef.taskDefStackName,
|
StackName: taskDef.taskDefStackName,
|
||||||
}).promise();
|
}).promise();
|
||||||
|
|
||||||
await CF.deleteStack({
|
await CF.deleteStack({
|
||||||
StackName: taskDef.taskDefStackNameTTL,
|
StackName: taskDef.taskDefStackNameTTL,
|
||||||
}).promise();
|
}).promise();
|
||||||
|
|
@ -366,12 +365,14 @@ class AWSBuildEnvironment implements CloudRunnerProviderInterface {
|
||||||
await CF.waitFor('stackDeleteComplete', {
|
await CF.waitFor('stackDeleteComplete', {
|
||||||
StackName: taskDef.taskDefStackName,
|
StackName: taskDef.taskDefStackName,
|
||||||
}).promise();
|
}).promise();
|
||||||
|
|
||||||
// Currently too slow and causes too much waiting
|
|
||||||
await CF.waitFor('stackDeleteComplete', {
|
await CF.waitFor('stackDeleteComplete', {
|
||||||
StackName: taskDef.taskDefStackNameTTL,
|
StackName: taskDef.taskDefStackNameTTL,
|
||||||
}).promise();
|
}).promise();
|
||||||
|
|
||||||
|
const stacks = await CF.listStacks().promise();
|
||||||
|
|
||||||
|
core.info(`Stacks: ${JSON.stringify(stacks, undefined, 4)}`);
|
||||||
|
|
||||||
core.info('Cleanup complete');
|
core.info('Cleanup complete');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue