Compiled
parent
b048e94e52
commit
c794bde952
|
@ -1596,6 +1596,7 @@ class AWSCloudFormationTemplates {
|
||||||
}
|
}
|
||||||
static getSecretDefinitionTemplate(p1, p2) {
|
static getSecretDefinitionTemplate(p1, p2) {
|
||||||
return `
|
return `
|
||||||
|
Secrets:
|
||||||
- Name: '${p1}'
|
- Name: '${p1}'
|
||||||
ValueFrom: !Ref ${p2}Secret
|
ValueFrom: !Ref ${p2}Secret
|
||||||
`;
|
`;
|
||||||
|
@ -1710,7 +1711,7 @@ class AWSJobStack {
|
||||||
}
|
}
|
||||||
taskDefCloudFormation = aws_cloud_formation_templates_1.AWSCloudFormationTemplates.insertAtTemplate(taskDefCloudFormation, 'p1 - input', aws_cloud_formation_templates_1.AWSCloudFormationTemplates.getParameterTemplate(secret.ParameterKey));
|
taskDefCloudFormation = aws_cloud_formation_templates_1.AWSCloudFormationTemplates.insertAtTemplate(taskDefCloudFormation, 'p1 - input', aws_cloud_formation_templates_1.AWSCloudFormationTemplates.getParameterTemplate(secret.ParameterKey));
|
||||||
taskDefCloudFormation = aws_cloud_formation_templates_1.AWSCloudFormationTemplates.insertAtTemplate(taskDefCloudFormation, '# template resources secrets', aws_cloud_formation_templates_1.AWSCloudFormationTemplates.getSecretTemplate(`${secret.ParameterKey}`));
|
taskDefCloudFormation = aws_cloud_formation_templates_1.AWSCloudFormationTemplates.insertAtTemplate(taskDefCloudFormation, '# template resources secrets', aws_cloud_formation_templates_1.AWSCloudFormationTemplates.getSecretTemplate(`${secret.ParameterKey}`));
|
||||||
taskDefCloudFormation = aws_cloud_formation_templates_1.AWSCloudFormationTemplates.insertAtTemplate(taskDefCloudFormation, 'p3 - container def', aws_cloud_formation_templates_1.AWSCloudFormationTemplates.getSecretDefinitionTemplate(secret.EnvironmentVariable, secret.ParameterKey));
|
taskDefCloudFormation = aws_cloud_formation_templates_1.AWSCloudFormationTemplates.insertAtTemplate(taskDefCloudFormation, '# template secrets p3 - container def', aws_cloud_formation_templates_1.AWSCloudFormationTemplates.getSecretDefinitionTemplate(secret.EnvironmentVariable, secret.ParameterKey));
|
||||||
}
|
}
|
||||||
const secretsMappedToCloudFormationParameters = secrets.map((x) => {
|
const secretsMappedToCloudFormationParameters = secrets.map((x) => {
|
||||||
return { ParameterKey: x.ParameterKey.replace(/[^\dA-Za-z]/g, ''), ParameterValue: x.ParameterValue };
|
return { ParameterKey: x.ParameterKey.replace(/[^\dA-Za-z]/g, ''), ParameterValue: x.ParameterValue };
|
||||||
|
@ -1751,6 +1752,7 @@ class AWSJobStack {
|
||||||
},
|
},
|
||||||
...secretsMappedToCloudFormationParameters,
|
...secretsMappedToCloudFormationParameters,
|
||||||
];
|
];
|
||||||
|
cloud_runner_logger_1.default.log(`TaskDef: ${taskDefCloudFormation}`);
|
||||||
cloud_runner_logger_1.default.log(`Starting AWS job with memory: ${cloud_runner_1.default.buildParameters.containerMemory} cpu: ${cloud_runner_1.default.buildParameters.containerCpu}`);
|
cloud_runner_logger_1.default.log(`Starting AWS job with memory: ${cloud_runner_1.default.buildParameters.containerMemory} cpu: ${cloud_runner_1.default.buildParameters.containerCpu}`);
|
||||||
let previousStackExists = true;
|
let previousStackExists = true;
|
||||||
while (previousStackExists) {
|
while (previousStackExists) {
|
||||||
|
@ -1774,7 +1776,9 @@ class AWSJobStack {
|
||||||
Capabilities: ['CAPABILITY_IAM'],
|
Capabilities: ['CAPABILITY_IAM'],
|
||||||
Parameters: parameters,
|
Parameters: parameters,
|
||||||
};
|
};
|
||||||
|
cloud_runner_logger_1.default.log(`StackInput: ${createStackInput}`);
|
||||||
try {
|
try {
|
||||||
|
cloud_runner_logger_1.default.log(`TaskDef Cloud formation: ${taskDefCloudFormation}`);
|
||||||
cloud_runner_logger_1.default.log(`Creating job aws formation ${taskDefStackName}`);
|
cloud_runner_logger_1.default.log(`Creating job aws formation ${taskDefStackName}`);
|
||||||
await CF.createStack(createStackInput).promise();
|
await CF.createStack(createStackInput).promise();
|
||||||
await CF.waitFor('stackCreateComplete', { StackName: taskDefStackName }).promise();
|
await CF.waitFor('stackCreateComplete', { StackName: taskDefStackName }).promise();
|
||||||
|
@ -2760,8 +2764,7 @@ Resources:
|
||||||
- SourceVolume: efs-data
|
- SourceVolume: efs-data
|
||||||
ContainerPath: !Ref EFSMountDirectory
|
ContainerPath: !Ref EFSMountDirectory
|
||||||
ReadOnly: false
|
ReadOnly: false
|
||||||
Secrets:
|
# template secrets p3 - container def
|
||||||
# template secrets p3 - container def
|
|
||||||
LogConfiguration:
|
LogConfiguration:
|
||||||
LogDriver: awslogs
|
LogDriver: awslogs
|
||||||
Options:
|
Options:
|
||||||
|
@ -8012,7 +8015,7 @@ class Versioning {
|
||||||
static async getVersionDescription() {
|
static async getVersionDescription() {
|
||||||
const versionTags = (await this.git(['tag', '--list', '--merged', 'HEAD', '--sort=-creatordate']))
|
const versionTags = (await this.git(['tag', '--list', '--merged', 'HEAD', '--sort=-creatordate']))
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.filter(tag => new RegExp(this.grepCompatibleInputVersionRegex).test(tag));
|
.filter((tag) => new RegExp(this.grepCompatibleInputVersionRegex).test(tag));
|
||||||
if (versionTags.length === 0) {
|
if (versionTags.length === 0) {
|
||||||
core.warning('No valid version tags found. Using fallback description.');
|
core.warning('No valid version tags found. Using fallback description.');
|
||||||
return this.git(['describe', '--long', '--tags', '--always', 'HEAD']);
|
return this.git(['describe', '--long', '--tags', '--always', 'HEAD']);
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue