remove trailing new lines
parent
43a37a0daf
commit
2d86865cb6
|
|
@ -1214,12 +1214,12 @@ class AWS {
|
|||
const ECS = new SDK.ECS();
|
||||
const CF = new SDK.CloudFormation();
|
||||
const entrypoint = ['/bin/sh'];
|
||||
const taskDef = yield this.setupCloudFormations(CF, buildId, stackName, image, entrypoint, commands, mountdir, workingdir, environment, secrets);
|
||||
const taskDef = yield this.setupCloudFormations(CF, buildId, stackName, image, entrypoint, commands, mountdir, workingdir, secrets);
|
||||
yield this.runTask(taskDef, ECS, CF, environment, buildId);
|
||||
yield this.cleanupResources(CF, taskDef);
|
||||
});
|
||||
}
|
||||
static setupCloudFormations(CF, buildUid, stackName, image, entrypoint, commands, mountdir, workingdir, environment, secrets) {
|
||||
static setupCloudFormations(CF, buildUid, stackName, image, entrypoint, commands, mountdir, workingdir, secrets) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const logid = nanoid_1.customAlphabet(remote_builder_alphabet_1.default.alphabet, 9)();
|
||||
commands[1] += `
|
||||
|
|
@ -1267,30 +1267,6 @@ class AWS {
|
|||
taskDefCloudFormation.slice(indexp3),
|
||||
].join('');
|
||||
}
|
||||
for (const environmentVariable of environment) {
|
||||
const insertionStringKey = 'p1 - input';
|
||||
const index = taskDefCloudFormation.search(insertionStringKey) + insertionStringKey.length + '\n'.length;
|
||||
const parameterTemplate = `
|
||||
${environmentVariable.name.replace(/[^\dA-Za-z]/g, '')}:
|
||||
Type: String
|
||||
Default: ''
|
||||
`;
|
||||
taskDefCloudFormation = [
|
||||
taskDefCloudFormation.slice(0, index),
|
||||
parameterTemplate,
|
||||
taskDefCloudFormation.slice(index),
|
||||
].join('');
|
||||
const insertionStringKeyContainerDef = 'template - env vars';
|
||||
const indexContainerDef = taskDefCloudFormation.search(insertionStringKeyContainerDef) + insertionStringKeyContainerDef.length;
|
||||
const parameterContainerDefTemplate = `
|
||||
- Name: '${environmentVariable.name}'
|
||||
ValueFrom: !Ref ${environmentVariable.name.replace(/[^\dA-Za-z]/g, '')}`;
|
||||
taskDefCloudFormation = [
|
||||
taskDefCloudFormation.slice(0, indexContainerDef),
|
||||
parameterContainerDefTemplate,
|
||||
taskDefCloudFormation.slice(indexContainerDef),
|
||||
].join('');
|
||||
}
|
||||
const mappedSecrets = secrets.map((x) => {
|
||||
return { ParameterKey: x.ParameterKey.replace(/[^\dA-Za-z]/g, ''), ParameterValue: x.ParameterValue };
|
||||
});
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -32,7 +32,6 @@ class AWS {
|
|||
commands,
|
||||
mountdir,
|
||||
workingdir,
|
||||
environment,
|
||||
secrets,
|
||||
);
|
||||
|
||||
|
|
@ -50,7 +49,6 @@ class AWS {
|
|||
commands: string[],
|
||||
mountdir: string,
|
||||
workingdir: string,
|
||||
environment: RemoteBuilderEnvironmentVariable[],
|
||||
secrets: RemoteBuilderSecret[],
|
||||
): Promise<RemoteBuilderTaskDef> {
|
||||
const logid = customAlphabet(RemoteBuilderAlphabet.alphabet, 9)();
|
||||
|
|
@ -104,31 +102,6 @@ class AWS {
|
|||
taskDefCloudFormation.slice(indexp3),
|
||||
].join('');
|
||||
}
|
||||
for (const environmentVariable of environment) {
|
||||
const insertionStringKey = 'p1 - input';
|
||||
const index = taskDefCloudFormation.search(insertionStringKey) + insertionStringKey.length + '\n'.length;
|
||||
const parameterTemplate = `
|
||||
${environmentVariable.name.replace(/[^\dA-Za-z]/g, '')}:
|
||||
Type: String
|
||||
Default: ''
|
||||
`;
|
||||
taskDefCloudFormation = [
|
||||
taskDefCloudFormation.slice(0, index),
|
||||
parameterTemplate,
|
||||
taskDefCloudFormation.slice(index),
|
||||
].join('');
|
||||
const insertionStringKeyContainerDef = 'template - env vars';
|
||||
const indexContainerDef =
|
||||
taskDefCloudFormation.search(insertionStringKeyContainerDef) + insertionStringKeyContainerDef.length;
|
||||
const parameterContainerDefTemplate = `
|
||||
- Name: '${environmentVariable.name}'
|
||||
ValueFrom: !Ref ${environmentVariable.name.replace(/[^\dA-Za-z]/g, '')}`;
|
||||
taskDefCloudFormation = [
|
||||
taskDefCloudFormation.slice(0, indexContainerDef),
|
||||
parameterContainerDefTemplate,
|
||||
taskDefCloudFormation.slice(indexContainerDef),
|
||||
].join('');
|
||||
}
|
||||
const mappedSecrets = secrets.map((x) => {
|
||||
return { ParameterKey: x.ParameterKey.replace(/[^\dA-Za-z]/g, ''), ParameterValue: x.ParameterValue };
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue