mirror of
https://github.com/game-ci/unity-builder.git
synced 2025-07-04 12:25:19 -04:00
Fixed aws to work when no secrets specified
This commit is contained in:
parent
83c85328dd
commit
b048e94e52
@ -21,6 +21,7 @@ export class AWSCloudFormationTemplates {
|
|||||||
|
|
||||||
public static getSecretDefinitionTemplate(p1: string, p2: string) {
|
public static getSecretDefinitionTemplate(p1: string, p2: string) {
|
||||||
return `
|
return `
|
||||||
|
Secrets:
|
||||||
- Name: '${p1}'
|
- Name: '${p1}'
|
||||||
ValueFrom: !Ref ${p2}Secret
|
ValueFrom: !Ref ${p2}Secret
|
||||||
`;
|
`;
|
||||||
|
@ -70,7 +70,7 @@ export class AWSJobStack {
|
|||||||
);
|
);
|
||||||
taskDefCloudFormation = AWSCloudFormationTemplates.insertAtTemplate(
|
taskDefCloudFormation = AWSCloudFormationTemplates.insertAtTemplate(
|
||||||
taskDefCloudFormation,
|
taskDefCloudFormation,
|
||||||
'p3 - container def',
|
'# template secrets p3 - container def',
|
||||||
AWSCloudFormationTemplates.getSecretDefinitionTemplate(secret.EnvironmentVariable, secret.ParameterKey),
|
AWSCloudFormationTemplates.getSecretDefinitionTemplate(secret.EnvironmentVariable, secret.ParameterKey),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -113,9 +113,13 @@ export class AWSJobStack {
|
|||||||
},
|
},
|
||||||
...secretsMappedToCloudFormationParameters,
|
...secretsMappedToCloudFormationParameters,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
CloudRunnerLogger.log(`TaskDef: ${taskDefCloudFormation}`);
|
||||||
|
|
||||||
CloudRunnerLogger.log(
|
CloudRunnerLogger.log(
|
||||||
`Starting AWS job with memory: ${CloudRunner.buildParameters.containerMemory} cpu: ${CloudRunner.buildParameters.containerCpu}`,
|
`Starting AWS job with memory: ${CloudRunner.buildParameters.containerMemory} cpu: ${CloudRunner.buildParameters.containerCpu}`,
|
||||||
);
|
);
|
||||||
|
|
||||||
let previousStackExists = true;
|
let previousStackExists = true;
|
||||||
while (previousStackExists) {
|
while (previousStackExists) {
|
||||||
previousStackExists = false;
|
previousStackExists = false;
|
||||||
@ -132,13 +136,17 @@ export class AWSJobStack {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const createStackInput: SDK.CloudFormation.CreateStackInput = {
|
const createStackInput: SDK.CloudFormation.CreateStackInput = {
|
||||||
StackName: taskDefStackName,
|
StackName: taskDefStackName,
|
||||||
TemplateBody: taskDefCloudFormation,
|
TemplateBody: taskDefCloudFormation,
|
||||||
Capabilities: ['CAPABILITY_IAM'],
|
Capabilities: ['CAPABILITY_IAM'],
|
||||||
Parameters: parameters,
|
Parameters: parameters,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CloudRunnerLogger.log(`StackInput: ${createStackInput}`);
|
||||||
try {
|
try {
|
||||||
|
CloudRunnerLogger.log(`TaskDef Cloud formation: ${taskDefCloudFormation}`);
|
||||||
CloudRunnerLogger.log(`Creating job aws formation ${taskDefStackName}`);
|
CloudRunnerLogger.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();
|
||||||
|
@ -127,7 +127,6 @@ 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
|
||||||
|
Loading…
Reference in New Issue
Block a user