cleanup printing cloud formation yaml

pull/263/head
Frostebite 2021-05-02 04:52:21 +01:00
parent e3fb2e55b2
commit c4b2d441c5
3 changed files with 7 additions and 10 deletions

7
dist/index.js vendored
View File

@ -1272,7 +1272,7 @@ class AWS {
const insertionStringKey = 'p1 - input'; const insertionStringKey = 'p1 - input';
const index = taskDefCloudFormation.search(insertionStringKey) + insertionStringKey.length + '\n'.length; const index = taskDefCloudFormation.search(insertionStringKey) + insertionStringKey.length + '\n'.length;
const parameterTemplate = ` const parameterTemplate = `
${environmentVariable.name}: ${environmentVariable.name.replace(/[^\dA-Za-z]/g, '')}:
Type: String Type: String
Default: '' Default: ''
`; `;
@ -1287,7 +1287,7 @@ class AWS {
'\n'.length; '\n'.length;
const parameterContainerDefTemplate = ` const parameterContainerDefTemplate = `
- Name: '${environmentVariable.name}' - Name: '${environmentVariable.name}'
ValueFrom: !Ref ${environmentVariable.name} ValueFrom: !Ref ${environmentVariable.name.replace(/[^\dA-Za-z]/g, '')}
`; `;
taskDefCloudFormation = [ taskDefCloudFormation = [
taskDefCloudFormation.slice(0, indexContainerDef), taskDefCloudFormation.slice(0, indexContainerDef),
@ -1295,9 +1295,8 @@ class AWS {
taskDefCloudFormation.slice(indexContainerDef), taskDefCloudFormation.slice(indexContainerDef),
].join(''); ].join('');
} }
core.info(taskDefCloudFormation);
const mappedSecrets = secrets.map((x) => { const mappedSecrets = secrets.map((x) => {
return { ParameterKey: x.ParameterKey, ParameterValue: x.ParameterValue }; return { ParameterKey: x.ParameterKey.replace(/[^\dA-Za-z]/g, ''), ParameterValue: x.ParameterValue };
}); });
yield CF.createStack({ yield CF.createStack({
StackName: taskDefStackName, StackName: taskDefStackName,

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -107,7 +107,7 @@ class AWS {
const insertionStringKey = 'p1 - input'; const insertionStringKey = 'p1 - input';
const index = taskDefCloudFormation.search(insertionStringKey) + insertionStringKey.length + '\n'.length; const index = taskDefCloudFormation.search(insertionStringKey) + insertionStringKey.length + '\n'.length;
const parameterTemplate = ` const parameterTemplate = `
${environmentVariable.name}: ${environmentVariable.name.replace(/[^\dA-Za-z]/g, '')}:
Type: String Type: String
Default: '' Default: ''
`; `;
@ -123,7 +123,7 @@ class AWS {
'\n'.length; '\n'.length;
const parameterContainerDefTemplate = ` const parameterContainerDefTemplate = `
- Name: '${environmentVariable.name}' - Name: '${environmentVariable.name}'
ValueFrom: !Ref ${environmentVariable.name} ValueFrom: !Ref ${environmentVariable.name.replace(/[^\dA-Za-z]/g, '')}
`; `;
taskDefCloudFormation = [ taskDefCloudFormation = [
taskDefCloudFormation.slice(0, indexContainerDef), taskDefCloudFormation.slice(0, indexContainerDef),
@ -131,10 +131,8 @@ class AWS {
taskDefCloudFormation.slice(indexContainerDef), taskDefCloudFormation.slice(indexContainerDef),
].join(''); ].join('');
} }
core.info(taskDefCloudFormation);
const mappedSecrets = secrets.map((x) => { const mappedSecrets = secrets.map((x) => {
return { ParameterKey: x.ParameterKey, ParameterValue: x.ParameterValue }; return { ParameterKey: x.ParameterKey.replace(/[^\dA-Za-z]/g, ''), ParameterValue: x.ParameterValue };
}); });
await CF.createStack({ await CF.createStack({
StackName: taskDefStackName, StackName: taskDefStackName,