Skip to content

Commit 5c85165

Browse files
authored
Merge branch 'aws-actions:master' into master
2 parents 8af8df8 + 1a69dae commit 5c85165

File tree

3 files changed

+65
-65
lines changed

3 files changed

+65
-65
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ async function updateEcsService(ecs, clusterName, service, taskDefArn, waitForSe
160160
const region = await ecs.config.region();
161161
const consoleHostname = region.startsWith('cn') ? 'console.amazonaws.cn' : 'console.aws.amazon.com';
162162

163-
core.info(`Deployment started. Watch this deployment's progress in the Amazon ECS console: https://${consoleHostname}/ecs/home?region=${region}#/clusters/${clusterName}/services/${service}/events`);
163+
core.info(`Deployment started. Watch this deployment's progress in the Amazon ECS console: https://${region}.${consoleHostname}/ecs/v2/clusters/${clusterName}/services/${service}/events?region=${region}`);
164164

165165
// Wait for service stability
166166
if (waitForService && waitForService.toLowerCase() === 'true') {

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ async function updateEcsService(ecs, clusterName, service, taskDefArn, waitForSe
154154
const region = await ecs.config.region();
155155
const consoleHostname = region.startsWith('cn') ? 'console.amazonaws.cn' : 'console.aws.amazon.com';
156156

157-
core.info(`Deployment started. Watch this deployment's progress in the Amazon ECS console: https://${consoleHostname}/ecs/home?region=${region}#/clusters/${clusterName}/services/${service}/events`);
157+
core.info(`Deployment started. Watch this deployment's progress in the Amazon ECS console: https://${region}.${consoleHostname}/ecs/v2/clusters/${clusterName}/services/${service}/events?region=${region}`);
158158

159159
// Wait for service stability
160160
if (waitForService && waitForService.toLowerCase() === 'true') {

index.test.js

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const mockRunTask = jest.fn();
2020
const mockWaitUntilTasksStopped = jest.fn().mockRejectedValue(new Error('failed'));
2121
const mockEcsDescribeTasks = jest.fn();
2222
const config = {
23-
region: () => Promise.resolve('fake-region'),
23+
region: () => Promise.resolve('fake-region'),
2424
};
2525

2626
jest.mock('@aws-sdk/client-codedeploy');
@@ -174,7 +174,7 @@ describe('Deploy to ECS', () => {
174174
test('registers the task definition contents and updates the service', async () => {
175175
await run();
176176
expect(core.setFailed).toHaveBeenCalledTimes(0);
177-
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family'});
177+
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family' });
178178
expect(core.setOutput).toHaveBeenNthCalledWith(1, 'task-definition-arn', 'task:def:arn');
179179
expect(mockEcsDescribeServices).toHaveBeenNthCalledWith(1, {
180180
cluster: 'cluster-789',
@@ -187,7 +187,7 @@ describe('Deploy to ECS', () => {
187187
forceNewDeployment: false,
188188
});
189189
expect(waitUntilServicesStable).toHaveBeenCalledTimes(0);
190-
expect(core.info).toBeCalledWith("Deployment started. Watch this deployment's progress in the Amazon ECS console: https://console.aws.amazon.com/ecs/home?region=fake-region#/clusters/cluster-789/services/service-456/events");
190+
expect(core.info).toBeCalledWith("Deployment started. Watch this deployment's progress in the Amazon ECS console: https://fake-region.console.aws.amazon.com/ecs/v2/clusters/cluster-789/services/service-456/events?region=fake-region");
191191
});
192192

193193

@@ -206,7 +206,7 @@ describe('Deploy to ECS', () => {
206206

207207
await run();
208208
expect(core.setFailed).toHaveBeenCalledTimes(0);
209-
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family'});
209+
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family' });
210210
expect(core.setOutput).toHaveBeenNthCalledWith(1, 'task-definition-arn', 'task:def:arn');
211211
expect(mockEcsDescribeServices).toHaveBeenNthCalledWith(1, {
212212
cluster: 'cluster-789',
@@ -220,7 +220,7 @@ describe('Deploy to ECS', () => {
220220

221221
});
222222
expect(waitUntilServicesStable).toHaveBeenCalledTimes(0);
223-
expect(core.info).toBeCalledWith("Deployment started. Watch this deployment's progress in the Amazon ECS console: https://console.aws.amazon.com/ecs/home?region=fake-region#/clusters/cluster-789/services/service-456/events");
223+
expect(core.info).toBeCalledWith("Deployment started. Watch this deployment's progress in the Amazon ECS console: https://fake-region.console.aws.amazon.com/ecs/v2/clusters/cluster-789/services/service-456/events?region=fake-region");
224224
});
225225

226226

@@ -229,7 +229,7 @@ describe('Deploy to ECS', () => {
229229
config.region = () => Promise.resolve('cn-fake-region');
230230
await run();
231231

232-
expect(core.info).toBeCalledWith("Deployment started. Watch this deployment's progress in the Amazon ECS console: https://console.amazonaws.cn/ecs/home?region=cn-fake-region#/clusters/cluster-789/services/service-456/events");
232+
expect(core.info).toBeCalledWith("Deployment started. Watch this deployment's progress in the Amazon ECS console: https://cn-fake-region.console.amazonaws.cn/ecs/v2/clusters/cluster-789/services/service-456/events?region=cn-fake-region");
233233

234234
// reset
235235
config.region = originalRegion;
@@ -247,7 +247,7 @@ describe('Deploy to ECS', () => {
247247

248248
await run();
249249
expect(core.setFailed).toHaveBeenCalledTimes(0);
250-
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family'});
250+
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family' });
251251
});
252252

253253

@@ -262,7 +262,7 @@ describe('Deploy to ECS', () => {
262262

263263
await run();
264264
expect(core.setFailed).toHaveBeenCalledTimes(0);
265-
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family'});
265+
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family' });
266266
});
267267

268268

@@ -328,7 +328,7 @@ describe('Deploy to ECS', () => {
328328
}]
329329
}
330330
],
331-
requiresCompatibilities: [ 'EC2' ]
331+
requiresCompatibilities: ['EC2']
332332
});
333333
});
334334

@@ -425,7 +425,7 @@ describe('Deploy to ECS', () => {
425425
}]
426426
}
427427
],
428-
requiresCompatibilities: [ 'EC2' ],
428+
requiresCompatibilities: ['EC2'],
429429
proxyConfiguration: {
430430
type: "APPMESH",
431431
containerName: "envoy",
@@ -479,7 +479,7 @@ describe('Deploy to ECS', () => {
479479

480480
await run();
481481
expect(core.setFailed).toHaveBeenCalledTimes(0);
482-
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family'});
482+
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family' });
483483
});
484484

485485

@@ -506,7 +506,7 @@ describe('Deploy to ECS', () => {
506506
await run();
507507
expect(core.setFailed).toHaveBeenCalledTimes(0);
508508

509-
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family'});
509+
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family' });
510510
expect(core.setOutput).toHaveBeenNthCalledWith(1, 'task-definition-arn', 'task:def:arn');
511511
expect(mockEcsDescribeServices).toHaveBeenNthCalledWith(1, {
512512
cluster: 'cluster-789',
@@ -519,21 +519,21 @@ describe('Deploy to ECS', () => {
519519
revision: {
520520
revisionType: 'AppSpecContent',
521521
appSpecContent: {
522-
content: JSON.stringify({
523-
Resources: [{
524-
TargetService: {
525-
Type: 'AWS::ECS::Service',
526-
Properties: {
527-
TaskDefinition: 'task:def:arn',
528-
LoadBalancerInfo: {
529-
ContainerName: "web",
530-
ContainerPort: 80
522+
content: JSON.stringify({
523+
Resources: [{
524+
TargetService: {
525+
Type: 'AWS::ECS::Service',
526+
Properties: {
527+
TaskDefinition: 'task:def:arn',
528+
LoadBalancerInfo: {
529+
ContainerName: "web",
530+
ContainerPort: 80
531+
}
531532
}
532-
}
533-
}
534-
}]
533+
}
534+
}]
535535
}),
536-
sha256: '0911d1e99f48b492e238d1284d8ddb805382d33e1d1fc74ffadf37d8b7e6d096'
536+
sha256: '0911d1e99f48b492e238d1284d8ddb805382d33e1d1fc74ffadf37d8b7e6d096'
537537
}
538538
}
539539
});
@@ -587,7 +587,7 @@ describe('Deploy to ECS', () => {
587587
await run();
588588
expect(core.setFailed).toHaveBeenCalledTimes(0);
589589

590-
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family'});
590+
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family' });
591591
expect(core.setOutput).toHaveBeenNthCalledWith(1, 'task-definition-arn', 'task:def:arn');
592592
expect(mockEcsDescribeServices).toHaveBeenNthCalledWith(1, {
593593
cluster: 'cluster-789',
@@ -600,21 +600,21 @@ describe('Deploy to ECS', () => {
600600
revision: {
601601
revisionType: 'AppSpecContent',
602602
appSpecContent: {
603-
content: JSON.stringify({
604-
Resources: [{
605-
TargetService: {
606-
Type: 'AWS::ECS::Service',
607-
Properties: {
608-
TaskDefinition: 'task:def:arn',
609-
LoadBalancerInfo: {
610-
ContainerName: "web",
611-
ContainerPort: 80
603+
content: JSON.stringify({
604+
Resources: [{
605+
TargetService: {
606+
Type: 'AWS::ECS::Service',
607+
Properties: {
608+
TaskDefinition: 'task:def:arn',
609+
LoadBalancerInfo: {
610+
ContainerName: "web",
611+
ContainerPort: 80
612+
}
612613
}
613-
}
614-
}
615-
}]
614+
}
615+
}]
616616
}),
617-
sha256: '0911d1e99f48b492e238d1284d8ddb805382d33e1d1fc74ffadf37d8b7e6d096'
617+
sha256: '0911d1e99f48b492e238d1284d8ddb805382d33e1d1fc74ffadf37d8b7e6d096'
618618
}
619619
}
620620
});
@@ -664,7 +664,7 @@ describe('Deploy to ECS', () => {
664664
await run();
665665
expect(core.setFailed).toHaveBeenCalledTimes(0);
666666

667-
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family'});
667+
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family' });
668668
expect(core.setOutput).toHaveBeenNthCalledWith(1, 'task-definition-arn', 'task:def:arn');
669669
expect(mockEcsDescribeServices).toHaveBeenNthCalledWith(1, {
670670
cluster: 'cluster-789',
@@ -677,21 +677,21 @@ describe('Deploy to ECS', () => {
677677
revision: {
678678
revisionType: 'AppSpecContent',
679679
appSpecContent: {
680-
content: JSON.stringify({
681-
Resources: [{
682-
TargetService: {
683-
Type: 'AWS::ECS::Service',
684-
Properties: {
685-
TaskDefinition: 'task:def:arn',
686-
LoadBalancerInfo: {
687-
ContainerName: "web",
688-
ContainerPort: 80
680+
content: JSON.stringify({
681+
Resources: [{
682+
TargetService: {
683+
Type: 'AWS::ECS::Service',
684+
Properties: {
685+
TaskDefinition: 'task:def:arn',
686+
LoadBalancerInfo: {
687+
ContainerName: "web",
688+
ContainerPort: 80
689+
}
689690
}
690-
}
691-
}
692-
}]
691+
}
692+
}]
693693
}),
694-
sha256: '0911d1e99f48b492e238d1284d8ddb805382d33e1d1fc74ffadf37d8b7e6d096'
694+
sha256: '0911d1e99f48b492e238d1284d8ddb805382d33e1d1fc74ffadf37d8b7e6d096'
695695
}
696696
}
697697
});
@@ -794,7 +794,7 @@ describe('Deploy to ECS', () => {
794794
await run();
795795
expect(core.setFailed).toHaveBeenCalledTimes(0);
796796

797-
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family'});
797+
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family' });
798798
expect(core.setOutput).toHaveBeenNthCalledWith(1, 'task-definition-arn', 'task:def:arn');
799799
expect(mockEcsDescribeServices).toHaveBeenNthCalledWith(1, {
800800
cluster: 'cluster-789',
@@ -861,7 +861,7 @@ describe('Deploy to ECS', () => {
861861
await run();
862862
expect(core.setFailed).toHaveBeenCalledTimes(0);
863863

864-
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family'});
864+
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family' });
865865
expect(core.setOutput).toHaveBeenNthCalledWith(1, 'task-definition-arn', 'task:def:arn');
866866
expect(mockEcsDescribeServices).toHaveBeenNthCalledWith(1, {
867867
cluster: 'cluster-789',
@@ -934,7 +934,7 @@ describe('Deploy to ECS', () => {
934934
await run();
935935
expect(core.setFailed).toHaveBeenCalledTimes(0);
936936

937-
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family-absolute-path'});
937+
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family-absolute-path' });
938938
expect(core.setOutput).toHaveBeenNthCalledWith(1, 'task-definition-arn', 'task:def:arn');
939939
});
940940

@@ -951,7 +951,7 @@ describe('Deploy to ECS', () => {
951951
await run();
952952
expect(core.setFailed).toHaveBeenCalledTimes(0);
953953

954-
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family'});
954+
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family' });
955955
expect(core.setOutput).toHaveBeenNthCalledWith(1, 'task-definition-arn', 'task:def:arn');
956956
expect(mockEcsDescribeServices).toHaveBeenNthCalledWith(1, {
957957
cluster: 'cluster-789',
@@ -992,7 +992,7 @@ describe('Deploy to ECS', () => {
992992
await run();
993993
expect(core.setFailed).toHaveBeenCalledTimes(0);
994994

995-
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family'});
995+
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family' });
996996
expect(core.setOutput).toHaveBeenNthCalledWith(1, 'task-definition-arn', 'task:def:arn');
997997
expect(mockEcsDescribeServices).toHaveBeenNthCalledWith(1, {
998998
cluster: 'cluster-789',
@@ -1032,7 +1032,7 @@ describe('Deploy to ECS', () => {
10321032
await run();
10331033
expect(core.setFailed).toHaveBeenCalledTimes(0);
10341034

1035-
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family'});
1035+
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family' });
10361036
expect(core.setOutput).toHaveBeenNthCalledWith(1, 'task-definition-arn', 'task:def:arn');
10371037
expect(mockEcsDescribeServices).toHaveBeenNthCalledWith(1, {
10381038
cluster: 'cluster-789',
@@ -1073,7 +1073,7 @@ describe('Deploy to ECS', () => {
10731073
await run();
10741074
expect(core.setFailed).toHaveBeenCalledTimes(0);
10751075

1076-
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family'});
1076+
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family' });
10771077
expect(core.setOutput).toHaveBeenNthCalledWith(1, 'task-definition-arn', 'task:def:arn');
10781078
expect(mockEcsDescribeServices).toHaveBeenNthCalledWith(1, {
10791079
cluster: 'cluster-789',
@@ -1099,7 +1099,7 @@ describe('Deploy to ECS', () => {
10991099
await run();
11001100
expect(core.setFailed).toHaveBeenCalledTimes(0);
11011101

1102-
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family'});
1102+
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family' });
11031103
expect(core.setOutput).toHaveBeenNthCalledWith(1, 'task-definition-arn', 'task:def:arn');
11041104
expect(mockEcsDescribeServices).toHaveBeenNthCalledWith(1, {
11051105
cluster: 'default',
@@ -1121,7 +1121,7 @@ describe('Deploy to ECS', () => {
11211121
await run();
11221122
expect(core.setFailed).toHaveBeenCalledTimes(0);
11231123

1124-
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family'});
1124+
expect(mockEcsRegisterTaskDef).toHaveBeenNthCalledWith(1, { family: 'task-def-family' });
11251125
expect(core.setOutput).toHaveBeenNthCalledWith(1, 'task-definition-arn', 'task:def:arn');
11261126
expect(mockEcsDescribeServices).toHaveBeenCalledTimes(0);
11271127
expect(mockEcsUpdateService).toHaveBeenCalledTimes(0);
@@ -1384,4 +1384,4 @@ describe('Deploy to ECS', () => {
13841384
expect(core.setFailed).toHaveBeenNthCalledWith(1, 'Failed to register task definition in ECS: Could not parse');
13851385
expect(core.setFailed).toHaveBeenNthCalledWith(2, 'Could not parse');
13861386
});
1387-
});
1387+
});

0 commit comments

Comments
 (0)