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