running git lfs clone
parent
fe64dd135a
commit
a8024abd13
File diff suppressed because one or more lines are too long
|
|
@ -48,6 +48,12 @@ Parameters:
|
||||||
EFSMountDirectory:
|
EFSMountDirectory:
|
||||||
Type: String
|
Type: String
|
||||||
Default: /efsdata
|
Default: /efsdata
|
||||||
|
SecretName:
|
||||||
|
Type: String
|
||||||
|
Default: 'Secret'
|
||||||
|
SecretValue:
|
||||||
|
Type: String
|
||||||
|
Default: ''
|
||||||
Mappings:
|
Mappings:
|
||||||
SubnetConfig:
|
SubnetConfig:
|
||||||
VPC:
|
VPC:
|
||||||
|
|
@ -94,6 +100,11 @@ Resources:
|
||||||
Metadata:
|
Metadata:
|
||||||
'AWS::CloudFormation::Designer':
|
'AWS::CloudFormation::Designer':
|
||||||
id: c6f18447-b879-4696-8873-f981b2cedd2b
|
id: c6f18447-b879-4696-8873-f981b2cedd2b
|
||||||
|
Secret:
|
||||||
|
Type: AWS::SecretsManager::Secret
|
||||||
|
Properties:
|
||||||
|
Name: !Ref SecretName
|
||||||
|
SecretString: !Ref SecretValue
|
||||||
TaskDefinition:
|
TaskDefinition:
|
||||||
Type: 'AWS::ECS::TaskDefinition'
|
Type: 'AWS::ECS::TaskDefinition'
|
||||||
Properties:
|
Properties:
|
||||||
|
|
@ -137,6 +148,9 @@ Resources:
|
||||||
- SourceVolume: efs-data
|
- SourceVolume: efs-data
|
||||||
ContainerPath: !Ref EFSMountDirectory
|
ContainerPath: !Ref EFSMountDirectory
|
||||||
ReadOnly: false
|
ReadOnly: false
|
||||||
|
Secrets:
|
||||||
|
- Name: !Ref SecretName
|
||||||
|
ValueFrom: !Ref Secret
|
||||||
LogConfiguration:
|
LogConfiguration:
|
||||||
LogDriver: awslogs
|
LogDriver: awslogs
|
||||||
Options:
|
Options:
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ class AWS {
|
||||||
value: buildId,
|
value: buildId,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
[],
|
||||||
);
|
);
|
||||||
await this.run(
|
await this.run(
|
||||||
buildParameters.awsStackName,
|
buildParameters.awsStackName,
|
||||||
|
|
@ -102,10 +103,22 @@ class AWS {
|
||||||
value: buildParameters.androidKeyaliasName,
|
value: buildParameters.androidKeyaliasName,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
{name: 'GITHUB_TOKEN',
|
||||||
|
value: base64.encode(buildParameters.githubToken),},
|
||||||
|
{name: 'UNITY_LICENSE',
|
||||||
|
value: base64.encode(process.env.UNITY_LICENSE),},
|
||||||
|
{name: 'ANDROID_KEYSTORE_BASE64',
|
||||||
|
value: base64.encode(buildParameters.androidKeystoreBase64),},
|
||||||
|
{name: 'ANDROID_KEYSTORE_PASS',
|
||||||
|
value: base64.encode(buildParameters.androidKeystorePass),},
|
||||||
|
{name: 'ANDROID_KEYALIAS_PASS',
|
||||||
|
value: base64.encode(buildParameters.androidKeyaliasPass),},
|
||||||
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static async run(stackName, image, entrypoint, commands, mountdir, workingdir, environment) {
|
static async run(stackName, image, entrypoint, commands, mountdir, workingdir, environment, secrets) {
|
||||||
const ECS = new SDK.ECS();
|
const ECS = new SDK.ECS();
|
||||||
const CF = new SDK.CloudFormation();
|
const CF = new SDK.CloudFormation();
|
||||||
|
|
||||||
|
|
@ -142,6 +155,14 @@ class AWS {
|
||||||
ParameterKey: 'EFSMountDirectory',
|
ParameterKey: 'EFSMountDirectory',
|
||||||
ParameterValue: mountdir,
|
ParameterValue: mountdir,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
ParameterKey: 'SecretName',
|
||||||
|
ParameterValue: 'Secrets'+nanoid(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ParameterKey: 'SecretValue',
|
||||||
|
ParameterValue: Buffer.from(JSON.stringify(secrets)).toString('base64'),
|
||||||
|
}
|
||||||
],
|
],
|
||||||
}).promise();
|
}).promise();
|
||||||
await CF.waitFor('stackCreateComplete', { StackName: taskDefStackName }).promise();
|
await CF.waitFor('stackCreateComplete', { StackName: taskDefStackName }).promise();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue