running git lfs clone
parent
55ad8231f1
commit
ff8fb25398
File diff suppressed because one or more lines are too long
|
|
@ -48,10 +48,19 @@ Parameters:
|
|||
EFSMountDirectory:
|
||||
Type: String
|
||||
Default: /efsdata
|
||||
SecretName:
|
||||
GitHubTokenSecret:
|
||||
Type: String
|
||||
Default: 'Secret'
|
||||
SecretValue:
|
||||
UnityLicenseSecret:
|
||||
Type: String
|
||||
Default: 'Secret'
|
||||
AndroidKeystoreBase64Secret:
|
||||
Type: String
|
||||
Default: 'Secret'
|
||||
AndroidKeystorePassSecret:
|
||||
Type: String
|
||||
Default: 'Secret'
|
||||
AndroidKeystoreAliasSecret:
|
||||
Type: String
|
||||
Default: ''
|
||||
Mappings:
|
||||
|
|
@ -100,11 +109,31 @@ Resources:
|
|||
Metadata:
|
||||
'AWS::CloudFormation::Designer':
|
||||
id: c6f18447-b879-4696-8873-f981b2cedd2b
|
||||
Secret:
|
||||
GitHubTokenSecret:
|
||||
Type: AWS::SecretsManager::Secret
|
||||
Properties:
|
||||
Name: !Ref SecretName
|
||||
SecretString: !Ref SecretValue
|
||||
Name: GitHubTokenSecret
|
||||
SecretString: !Ref GitHubTokenSecret
|
||||
UnityLicenseSecret:
|
||||
Type: AWS::SecretsManager::Secret
|
||||
Properties:
|
||||
Name: UnityLicenseSecret
|
||||
SecretString: !Ref UnityLicenseSecret
|
||||
AndroidKeystoreBase64Secret:
|
||||
Type: AWS::SecretsManager::Secret
|
||||
Properties:
|
||||
Name: AndroidKeystoreBase64Secret
|
||||
SecretString: !Ref AndroidKeystoreBase64Secret
|
||||
AndroidKeystorePassSecret:
|
||||
Type: AWS::SecretsManager::Secret
|
||||
Properties:
|
||||
Name: AndroidKeystorePassSecret
|
||||
SecretString: !Ref AndroidKeystorePassSecret
|
||||
AndroidKeystoreAliasSecret:
|
||||
Type: AWS::SecretsManager::Secret
|
||||
Properties:
|
||||
Name: AndroidKeystoreAliasSecret
|
||||
SecretString: !Ref AndroidKeystoreAliasSecret
|
||||
TaskDefinition:
|
||||
Type: 'AWS::ECS::TaskDefinition'
|
||||
Properties:
|
||||
|
|
@ -149,8 +178,18 @@ Resources:
|
|||
ContainerPath: !Ref EFSMountDirectory
|
||||
ReadOnly: false
|
||||
Secrets:
|
||||
- Name: !Ref SecretName
|
||||
ValueFrom: !Ref Secret
|
||||
- Name: GitHubTokenSecret
|
||||
ValueFrom: !Ref GitHubTokenSecret
|
||||
- Name: UnityLicenseSecret
|
||||
ValueFrom: !Ref UnityLicenseSecret
|
||||
- Name: !Ref AndroidKeystoreBase64Secret
|
||||
ValueFrom: !Ref AndroidKeystoreBase64Secret
|
||||
- Name: AndroidKeystorePassSecret
|
||||
ValueFrom: !Ref AndroidKeystorePassSecret
|
||||
- Name: AndroidKeystorePassSecret
|
||||
ValueFrom: !Ref AndroidKeystorePassSecret
|
||||
- Name: AndroidKeystoreAliasSecret
|
||||
ValueFrom: !Ref AndroidKeystoreAliasSecret
|
||||
LogConfiguration:
|
||||
LogDriver: awslogs
|
||||
Options:
|
||||
|
|
|
|||
|
|
@ -20,11 +20,13 @@ class AWS {
|
|||
'-c',
|
||||
`apk update;
|
||||
apk add git-lfs;
|
||||
apk add jq;
|
||||
ls;
|
||||
git clone https://github.com/${process.env.GITHUB_REPOSITORY}.git $BUILD_ID/repo;
|
||||
git clone https://github.com/webbertakken/unity-builder.git $BUILD_ID/builder;
|
||||
cd $BUILD_ID/repo;
|
||||
git checkout $GITHUB_SHA;
|
||||
echo $Secrets | base64 --decode | jq '.[]' |
|
||||
`],
|
||||
'/data',
|
||||
'/data/',
|
||||
|
|
@ -45,7 +47,7 @@ class AWS {
|
|||
baseImage.toString(),
|
||||
['/bin/sh'],
|
||||
['-c', `
|
||||
cat $
|
||||
|
||||
cp -r /data/$BUILD_ID/builder/action/default-build-script /UnityBuilderAction;
|
||||
cp -r /data/$BUILD_ID/builder/action/entrypoint.sh /entrypoint.sh;
|
||||
cp -r /data/$BUILD_ID/builder/action/steps /steps;
|
||||
|
|
@ -107,16 +109,26 @@ class AWS {
|
|||
},
|
||||
],
|
||||
[
|
||||
{name: 'GITHUB_TOKEN',
|
||||
value: buildParameters.githubToken,},
|
||||
{name: 'UNITY_LICENSE',
|
||||
value: process.env.UNITY_LICENSE,},
|
||||
{name: 'ANDROID_KEYSTORE_BASE64',
|
||||
value: buildParameters.androidKeystoreBase64,},
|
||||
{name: 'ANDROID_KEYSTORE_PASS',
|
||||
value: buildParameters.androidKeystorePass,},
|
||||
{name: 'ANDROID_KEYALIAS_PASS',
|
||||
value: buildParameters.androidKeyaliasPass,},
|
||||
{
|
||||
ParameterKey: 'GITHUB_TOKEN',
|
||||
ParameterValue: buildParameters.githubToken
|
||||
},
|
||||
{
|
||||
ParameterKey: 'UNITY_LICENSE',
|
||||
ParameterValue: process.env.UNITY_LICENSE
|
||||
},
|
||||
{
|
||||
ParameterKey: 'ANDROID_KEYSTORE_BASE64',
|
||||
ParameterValue: buildParameters.androidKeystoreBase64
|
||||
},
|
||||
{
|
||||
ParameterKey: 'ANDROID_KEYSTORE_PASS',
|
||||
ParameterValue: buildParameters.androidKeystorePass
|
||||
},
|
||||
{
|
||||
ParameterKey: 'ANDROID_KEYALIAS_PASS',
|
||||
ParameterValue: buildParameters.androidKeyaliasPass
|
||||
},
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
@ -165,12 +177,8 @@ class AWS {
|
|||
{
|
||||
ParameterKey: 'SecretName',
|
||||
ParameterValue: 'Secrets'+nanoid(),
|
||||
},
|
||||
{
|
||||
ParameterKey: 'SecretValue',
|
||||
ParameterValue: Buffer.from(JSON.stringify(secrets)).toString('base64'),
|
||||
}
|
||||
],
|
||||
].concat(secrets),
|
||||
}).promise();
|
||||
await CF.waitFor('stackCreateComplete', { StackName: taskDefStackName }).promise();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue