cleanup
parent
26fc8ef82d
commit
a3cf12c7c4
|
|
@ -225,7 +225,7 @@ class AWS {
|
|||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
const buildUid = nanoid_1.nanoid();
|
||||
core.info("starting part 1/4 (clone from github and restore cache)");
|
||||
core.info('starting part 1/4 (clone from github and restore cache)');
|
||||
yield this.run(buildUid, buildParameters.awsStackName, 'alpine/git', ['/bin/sh'], [
|
||||
'-c',
|
||||
`apk update;
|
||||
|
|
@ -270,7 +270,7 @@ class AWS {
|
|||
ParameterValue: buildParameters.githubToken,
|
||||
},
|
||||
]);
|
||||
core.info("starting part 2/4 (build)");
|
||||
core.info('starting part 2/4 (build)');
|
||||
yield this.run(buildUid, buildParameters.awsStackName, baseImage.toString(), ['/bin/sh'], [
|
||||
'-c',
|
||||
`
|
||||
|
|
@ -362,7 +362,7 @@ class AWS {
|
|||
ParameterValue: buildParameters.androidKeyaliasPass ? buildParameters.androidKeyaliasPass : '0',
|
||||
},
|
||||
]);
|
||||
core.info("starting part 3/4 (zip and publish latest Library to cache)");
|
||||
core.info('starting part 3/4 (zip and publish latest Library to cache)');
|
||||
// Cleanup
|
||||
yield this.run(buildUid, buildParameters.awsStackName, 'alpine', ['/bin/sh'], [
|
||||
'-c',
|
||||
|
|
@ -384,7 +384,7 @@ class AWS {
|
|||
ParameterValue: buildParameters.githubToken,
|
||||
},
|
||||
]);
|
||||
core.info("starting part 4/4 (upload to s3)");
|
||||
core.info('starting part 4/4 (upload to s3)');
|
||||
yield this.run(buildUid, buildParameters.awsStackName, 'amazon/aws-cli', ['/bin/sh'], [
|
||||
'-c',
|
||||
`
|
||||
|
|
@ -530,7 +530,7 @@ class AWS {
|
|||
const streamName = ((_m = (_l = taskDef.taskDefResources.StackResources) === null || _l === void 0 ? void 0 : _l.find((x) => x.LogicalResourceId === 'KinesisStream')) === null || _m === void 0 ? void 0 : _m.PhysicalResourceId) || '';
|
||||
const task = yield ECS.runTask({
|
||||
cluster: clusterName,
|
||||
taskDefinition: taskDefinition,
|
||||
taskDefinition,
|
||||
platformVersion: '1.4.0',
|
||||
overrides: {
|
||||
containerOverrides: [
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,5 +1,3 @@
|
|||
/* eslint-disable unicorn/prevent-abbreviations */
|
||||
|
||||
// Import these named export into your test file:
|
||||
export const mockProjectPath = jest.fn().mockResolvedValue('mockProjectPath');
|
||||
export const mockIsDirtyAllowed = jest.fn().mockResolvedValue(false);
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ class AWS {
|
|||
static async runBuildJob(buildParameters, baseImage) {
|
||||
try {
|
||||
const buildUid = nanoid();
|
||||
|
||||
core.info("starting part 1/4 (clone from github and restore cache)");
|
||||
|
||||
core.info('starting part 1/4 (clone from github and restore cache)');
|
||||
await this.run(
|
||||
buildUid,
|
||||
buildParameters.awsStackName,
|
||||
|
|
@ -64,8 +64,8 @@ class AWS {
|
|||
},
|
||||
],
|
||||
);
|
||||
|
||||
core.info("starting part 2/4 (build)");
|
||||
|
||||
core.info('starting part 2/4 (build)');
|
||||
await this.run(
|
||||
buildUid,
|
||||
buildParameters.awsStackName,
|
||||
|
|
@ -167,7 +167,7 @@ class AWS {
|
|||
},
|
||||
],
|
||||
);
|
||||
core.info("starting part 3/4 (zip and publish latest Library to cache)");
|
||||
core.info('starting part 3/4 (zip and publish latest Library to cache)');
|
||||
// Cleanup
|
||||
await this.run(
|
||||
buildUid,
|
||||
|
|
@ -200,7 +200,7 @@ class AWS {
|
|||
],
|
||||
);
|
||||
|
||||
core.info("starting part 4/4 (upload to s3)");
|
||||
core.info('starting part 4/4 (upload to s3)');
|
||||
await this.run(
|
||||
buildUid,
|
||||
buildParameters.awsStackName,
|
||||
|
|
@ -382,21 +382,25 @@ class AWS {
|
|||
static async runTask(taskDef, ECS, CF, environment, buildUid) {
|
||||
const clusterName =
|
||||
taskDef.baseResources.StackResources?.find((x) => x.LogicalResourceId === 'ECSCluster')?.PhysicalResourceId || '';
|
||||
const taskDefinition = taskDef.taskDefResources.StackResources?.find((x) => x.LogicalResourceId === 'TaskDefinition')
|
||||
?.PhysicalResourceId || '';
|
||||
const SubnetOne = taskDef.baseResources.StackResources?.find((x) => x.LogicalResourceId === 'PublicSubnetOne')
|
||||
?.PhysicalResourceId || '';
|
||||
const SubnetTwo = taskDef.baseResources.StackResources?.find((x) => x.LogicalResourceId === 'PublicSubnetTwo')
|
||||
?.PhysicalResourceId || '';
|
||||
const ContainerSecurityGroup = taskDef.baseResources.StackResources?.find((x) => x.LogicalResourceId === 'ContainerSecurityGroup')
|
||||
?.PhysicalResourceId || '';
|
||||
const taskDefinition =
|
||||
taskDef.taskDefResources.StackResources?.find((x) => x.LogicalResourceId === 'TaskDefinition')
|
||||
?.PhysicalResourceId || '';
|
||||
const SubnetOne =
|
||||
taskDef.baseResources.StackResources?.find((x) => x.LogicalResourceId === 'PublicSubnetOne')
|
||||
?.PhysicalResourceId || '';
|
||||
const SubnetTwo =
|
||||
taskDef.baseResources.StackResources?.find((x) => x.LogicalResourceId === 'PublicSubnetTwo')
|
||||
?.PhysicalResourceId || '';
|
||||
const ContainerSecurityGroup =
|
||||
taskDef.baseResources.StackResources?.find((x) => x.LogicalResourceId === 'ContainerSecurityGroup')
|
||||
?.PhysicalResourceId || '';
|
||||
const streamName =
|
||||
taskDef.taskDefResources.StackResources?.find((x) => x.LogicalResourceId === 'KinesisStream')
|
||||
?.PhysicalResourceId || '';
|
||||
|
||||
|
||||
const task = await ECS.runTask({
|
||||
cluster: clusterName,
|
||||
taskDefinition: taskDefinition,
|
||||
taskDefinition,
|
||||
platformVersion: '1.4.0',
|
||||
overrides: {
|
||||
containerOverrides: [
|
||||
|
|
@ -409,9 +413,9 @@ class AWS {
|
|||
launchType: 'FARGATE',
|
||||
networkConfiguration: {
|
||||
awsvpcConfiguration: {
|
||||
subnets: [ SubnetOne, SubnetTwo ],
|
||||
subnets: [SubnetOne, SubnetTwo],
|
||||
assignPublicIp: 'ENABLED',
|
||||
securityGroups: [ ContainerSecurityGroup ],
|
||||
securityGroups: [ContainerSecurityGroup],
|
||||
},
|
||||
},
|
||||
}).promise();
|
||||
|
|
|
|||
Loading…
Reference in New Issue