cleanup printing cloud formation yaml
parent
e3fb2e55b2
commit
c4b2d441c5
|
|
@ -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,
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue