insert test template into cloud formation
parent
a1f68ab26c
commit
fc7d03d0d6
|
|
@ -1,10 +1,10 @@
|
|||
name: AWS
|
||||
|
||||
on:
|
||||
push: { branches: [aws, aws-ts-clean] }
|
||||
push: { branches: [aws, remote-builder/refactor-cloudformation] }
|
||||
|
||||
env:
|
||||
AWS_REGION: "eu-west-1"
|
||||
AWS_REGION: 'eu-west-1'
|
||||
|
||||
jobs:
|
||||
buildForAllPlatforms:
|
||||
|
|
@ -17,7 +17,7 @@ jobs:
|
|||
projectPath:
|
||||
- test-project
|
||||
unityVersion:
|
||||
# - 2019.2.11f1
|
||||
# - 2019.2.11f1
|
||||
- 2019.3.15f1
|
||||
targetPlatform:
|
||||
#- StandaloneOSX # Build a macOS standalone (Intel 64-bit).
|
||||
|
|
|
|||
|
|
@ -81,6 +81,7 @@ Parameters:
|
|||
AWSSecretAccessKey:
|
||||
Type: String
|
||||
Default: '0'
|
||||
# template secrets p1 - input
|
||||
Mappings:
|
||||
SubnetConfig:
|
||||
VPC:
|
||||
|
|
@ -185,7 +186,9 @@ Resources:
|
|||
Properties:
|
||||
Name: !Join [ "", [ 'AWSSecretAccessKey', !Ref BUILDID ] ]
|
||||
SecretString: !Ref AWSSecretAccessKey
|
||||
|
||||
|
||||
# template secrets p2 - secret
|
||||
|
||||
TaskDefinition:
|
||||
Type: 'AWS::ECS::TaskDefinition'
|
||||
Properties:
|
||||
|
|
@ -230,6 +233,7 @@ Resources:
|
|||
ContainerPath: !Ref EFSMountDirectory
|
||||
ReadOnly: false
|
||||
Secrets:
|
||||
# template secrets p3 - container def
|
||||
- Name: 'GITHUB_TOKEN'
|
||||
ValueFrom: !Ref GithubTokenSecret
|
||||
- Name: 'UNITY_LICENSE'
|
||||
|
|
|
|||
|
|
@ -477,7 +477,18 @@ class AWS {
|
|||
echo "${logid}"
|
||||
`;
|
||||
const taskDefStackName = `${stackName}-${buildUid}`;
|
||||
const taskDefCloudFormation = fs.readFileSync(`${__dirname}/cloud-formations/task-def-formation.yml`, 'utf8');
|
||||
let taskDefCloudFormation = fs.readFileSync(`${__dirname}/cloud-formations/task-def-formation.yml`, 'utf8');
|
||||
const p3string = 'p3 - container def';
|
||||
const indexp3 = taskDefCloudFormation.search(p3string) + p3string.length + '\n'.length;
|
||||
const template = `
|
||||
- Name: 'test'
|
||||
ValueFrom: !Ref GithubTokenSecret
|
||||
`;
|
||||
taskDefCloudFormation = [
|
||||
taskDefCloudFormation.slice(0, indexp3),
|
||||
template,
|
||||
taskDefCloudFormation.slice(indexp3),
|
||||
].join('');
|
||||
yield CF.createStack({
|
||||
StackName: taskDefStackName,
|
||||
TemplateBody: taskDefCloudFormation,
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -332,7 +332,19 @@ class AWS {
|
|||
echo "${logid}"
|
||||
`;
|
||||
const taskDefStackName = `${stackName}-${buildUid}`;
|
||||
const taskDefCloudFormation = fs.readFileSync(`${__dirname}/cloud-formations/task-def-formation.yml`, 'utf8');
|
||||
let taskDefCloudFormation = fs.readFileSync(`${__dirname}/cloud-formations/task-def-formation.yml`, 'utf8');
|
||||
const p3string = 'p3 - container def';
|
||||
const indexp3 = taskDefCloudFormation.search(p3string) + p3string.length + '\n'.length;
|
||||
const template = `
|
||||
- Name: 'test'
|
||||
ValueFrom: !Ref GithubTokenSecret
|
||||
`;
|
||||
taskDefCloudFormation = [
|
||||
taskDefCloudFormation.slice(0, indexp3),
|
||||
template,
|
||||
taskDefCloudFormation.slice(indexp3),
|
||||
].join('');
|
||||
|
||||
await CF.createStack({
|
||||
StackName: taskDefStackName,
|
||||
TemplateBody: taskDefCloudFormation,
|
||||
|
|
|
|||
Loading…
Reference in New Issue