insert test template into cloud formation

pull/263/head
Frostebite 2021-05-02 02:02:14 +01:00
parent a1f68ab26c
commit fc7d03d0d6
5 changed files with 34 additions and 7 deletions

View File

@ -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).

View File

@ -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'

13
dist/index.js vendored
View File

@ -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,

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -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,