Skip to content

Commit be574a1

Browse files
authored
refactor(codepipeline): rename name in StageProps to stageName. (#2882)
BREAKING CHANGE: the property designating the name of the stage when creating a CodePipeline is now called `stageName` instead of `name`
1 parent c10fc9a commit be574a1

34 files changed

+138
-138
lines changed

packages/@aws-cdk/app-delivery/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const source = new codepipeline_actions.GitHubSourceAction({
7070
/* ... */
7171
});
7272
pipeline.addStage({
73-
name: 'source',
73+
stageName: 'source',
7474
actions: [source],
7575
});
7676

@@ -92,20 +92,20 @@ const buildAction = new codepipeline_actions.CodeBuildAction({
9292
outputs: [synthesizedApp],
9393
});
9494
pipeline.addStage({
95-
name: 'build',
95+
stageName: 'build',
9696
actions: [buildAction],
9797
});
9898

9999
// Optionally, self-update the pipeline stack
100-
const selfUpdateStage = pipeline.addStage({ name: 'SelfUpdate' });
100+
const selfUpdateStage = pipeline.addStage({ stageName: 'SelfUpdate' });
101101
new cicd.PipelineDeployStackAction(pipelineStack, 'SelfUpdatePipeline', {
102102
stage: selfUpdateStage,
103103
stack: pipelineStack,
104104
input: synthesizedApp,
105105
});
106106

107107
// Now add our service stacks
108-
const deployStage = pipeline.addStage({ name: 'Deploy' });
108+
const deployStage = pipeline.addStage({ stageName: 'Deploy' });
109109
const serviceStackA = new MyServiceStackA(app, 'ServiceStackA', { /* ... */ });
110110
// Add actions to deploy the stacks in the deploy stage:
111111
const deployServiceAAction = new cicd.PipelineDeployStackAction(pipelineStack, 'DeployServiceStackA', {

packages/@aws-cdk/app-delivery/test/integ.cicd.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ const source = new cpactions.GitHubSourceAction({
2323
output: sourceOutput,
2424
});
2525
pipeline.addStage({
26-
name: 'Source',
26+
stageName: 'Source',
2727
actions: [source],
2828
});
29-
const stage = pipeline.addStage({ name: 'Deploy' });
29+
const stage = pipeline.addStage({ stageName: 'Deploy' });
3030
new cicd.PipelineDeployStackAction(stack, 'DeployStack', {
3131
stage,
3232
stack,

packages/@aws-cdk/app-delivery/test/test.pipeline-deploy-stack-action.ts

+14-14
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ export = nodeunit.testCase({
3131
const pipeline = new codepipeline.Pipeline(stack, 'Pipeline');
3232
const fakeAction = new FakeAction('Fake');
3333
pipeline.addStage({
34-
name: 'FakeStage',
34+
stageName: 'FakeStage',
3535
actions: [fakeAction],
3636
});
3737
new PipelineDeployStackAction(stack, 'Action', {
3838
changeSetName: 'ChangeSet',
3939
input: fakeAction.outputArtifact,
4040
stack: new cdk.Stack(app, 'DeployedStack', { env: { account: stackAccount } }),
41-
stage: pipeline.addStage({ name: 'DeployStage' }),
41+
stage: pipeline.addStage({ stageName: 'DeployStage' }),
4242
adminPermissions: false,
4343
});
4444
}, 'Cross-environment deployment is not supported');
@@ -60,7 +60,7 @@ export = nodeunit.testCase({
6060
const pipeline = new codepipeline.Pipeline(stack, 'Pipeline');
6161
const fakeAction = new FakeAction('Fake');
6262
pipeline.addStage({
63-
name: 'FakeStage',
63+
stageName: 'FakeStage',
6464
actions: [fakeAction],
6565
});
6666
new PipelineDeployStackAction(stack, 'Action', {
@@ -69,7 +69,7 @@ export = nodeunit.testCase({
6969
executeChangeSetRunOrder: executeRunOrder,
7070
input: fakeAction.outputArtifact,
7171
stack: new cdk.Stack(app, 'DeployedStack'),
72-
stage: pipeline.addStage({ name: 'DeployStage' }),
72+
stage: pipeline.addStage({ stageName: 'DeployStage' }),
7373
adminPermissions: false,
7474
});
7575
}, 'createChangeSetRunOrder must be < executeChangeSetRunOrder');
@@ -89,9 +89,9 @@ export = nodeunit.testCase({
8989
const selfUpdatingStack = createSelfUpdatingStack(pipelineStack);
9090

9191
const pipeline = selfUpdatingStack.pipeline;
92-
const selfUpdateStage1 = pipeline.addStage({ name: 'SelfUpdate1' });
93-
const selfUpdateStage2 = pipeline.addStage({ name: 'SelfUpdate2' });
94-
const selfUpdateStage3 = pipeline.addStage({ name: 'SelfUpdate3' });
92+
const selfUpdateStage1 = pipeline.addStage({ stageName: 'SelfUpdate1' });
93+
const selfUpdateStage2 = pipeline.addStage({ stageName: 'SelfUpdate2' });
94+
const selfUpdateStage3 = pipeline.addStage({ stageName: 'SelfUpdate3' });
9595

9696
new PipelineDeployStackAction(pipelineStack, 'SelfUpdatePipeline', {
9797
stage: selfUpdateStage1,
@@ -155,7 +155,7 @@ export = nodeunit.testCase({
155155
const selfUpdatingStack = createSelfUpdatingStack(pipelineStack);
156156

157157
const pipeline = selfUpdatingStack.pipeline;
158-
const selfUpdateStage = pipeline.addStage({ name: 'SelfUpdate' });
158+
const selfUpdateStage = pipeline.addStage({ stageName: 'SelfUpdate' });
159159
new PipelineDeployStackAction(pipelineStack, 'SelfUpdatePipeline', {
160160
stage: selfUpdateStage,
161161
stack: pipelineStack,
@@ -191,7 +191,7 @@ export = nodeunit.testCase({
191191
assumedBy: new iam.ServicePrincipal('cloudformation.amazonaws.com'),
192192
});
193193
const pipeline = selfUpdatingStack.pipeline;
194-
const selfUpdateStage = pipeline.addStage({ name: 'SelfUpdate' });
194+
const selfUpdateStage = pipeline.addStage({ stageName: 'SelfUpdate' });
195195
const deployAction = new PipelineDeployStackAction(pipelineStack, 'SelfUpdatePipeline', {
196196
stage: selfUpdateStage,
197197
stack: pipelineStack,
@@ -214,7 +214,7 @@ export = nodeunit.testCase({
214214

215215
// WHEN //
216216
// this our app/service/infra to deploy
217-
const deployStage = pipeline.addStage({ name: 'Deploy' });
217+
const deployStage = pipeline.addStage({ stageName: 'Deploy' });
218218
const deployAction = new PipelineDeployStackAction(pipelineStack, 'DeployServiceStackA', {
219219
stage: deployStage,
220220
stack: emptyStack,
@@ -276,11 +276,11 @@ export = nodeunit.testCase({
276276
const pipeline = new codepipeline.Pipeline(stack, 'Pipeline');
277277
const fakeAction = new FakeAction('Fake');
278278
pipeline.addStage({
279-
name: 'FakeStage',
279+
stageName: 'FakeStage',
280280
actions: [fakeAction],
281281
});
282282
const deployedStack = new cdk.Stack(app, 'DeployedStack');
283-
const deployStage = pipeline.addStage({ name: 'DeployStage' });
283+
const deployStage = pipeline.addStage({ stageName: 'DeployStage' });
284284
const action = new PipelineDeployStackAction(stack, 'Action', {
285285
changeSetName: 'ChangeSet',
286286
input: fakeAction.outputArtifact,
@@ -338,7 +338,7 @@ function createSelfUpdatingStack(pipelineStack: cdk.Stack): SelfUpdatingPipeline
338338
output: sourceOutput,
339339
});
340340
pipeline.addStage({
341-
name: 'source',
341+
stageName: 'source',
342342
actions: [sourceAction],
343343
});
344344

@@ -351,7 +351,7 @@ function createSelfUpdatingStack(pipelineStack: cdk.Stack): SelfUpdatingPipeline
351351
outputs: [buildOutput],
352352
});
353353
pipeline.addStage({
354-
name: 'build',
354+
stageName: 'build',
355355
actions: [buildAction],
356356
});
357357
return {synthesizedApp: buildOutput, pipeline};

packages/@aws-cdk/aws-codepipeline-actions/README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const sourceAction = new codepipeline_actions.CodeCommitSourceAction({
4242
output: sourceOutput,
4343
});
4444
pipeline.addStage({
45-
name: 'Source',
45+
stageName: 'Source',
4646
actions: [sourceAction],
4747
});
4848
```
@@ -65,7 +65,7 @@ const sourceAction = new codepipeline_actions.GitHubSourceAction({
6565
trigger: codepipeline_actions.GitHubTrigger.Poll // default: 'WebHook', 'None' is also possible for no Source trigger
6666
});
6767
pipeline.addStage({
68-
name: 'Source',
68+
stageName: 'Source',
6969
actions: [sourceAction],
7070
});
7171
```
@@ -90,7 +90,7 @@ const sourceAction = new codepipeline_actions.S3SourceAction({
9090
output: sourceOutput,
9191
});
9292
pipeline.addStage({
93-
name: 'Source',
93+
stageName: 'Source',
9494
actions: [sourceAction],
9595
});
9696
```
@@ -136,7 +136,7 @@ const sourceAction = new codepipeline_actions.EcrSourceAction({
136136
output: sourceOutput,
137137
});
138138
pipeline.addStage({
139-
actionName: 'Source',
139+
stageName: 'Source',
140140
actions: [sourceAction],
141141
});
142142
```
@@ -172,11 +172,11 @@ const buildAction = new codepipeline_actions.CodeBuildAction({
172172
new codepipeline.Pipeline(this, 'MyPipeline', {
173173
stages: [
174174
{
175-
name: 'Source',
175+
stageName: 'Source',
176176
actions: [sourceAction],
177177
},
178178
{
179-
name: 'Build',
179+
stageName: 'Build',
180180
actions: [buildAction],
181181
},
182182
],
@@ -382,7 +382,7 @@ const deployAction = new codepipeline_actions.CodeDeployServerDeployAction({
382382
deploymentGroup,
383383
});
384384
pipeline.addStage({
385-
name: 'Deploy',
385+
stageName: 'Deploy',
386386
actions: [deployAction],
387387
});
388388
```
@@ -423,7 +423,7 @@ The deploy Action receives one input Artifact which contains the [image definiti
423423
424424
```typescript
425425
const deployStage = pipeline.addStage({
426-
name: 'Deploy',
426+
stageName: 'Deploy',
427427
actions: [
428428
new codepipeline_actions.EcsDeployAction({
429429
actionName: 'DeployAction',
@@ -458,7 +458,7 @@ const deployAction = new codepipeline_actions.S3DeployAction({
458458
input: sourceOutput,
459459
});
460460
const deployStage = pipeline.addStage({
461-
name: 'Deploy',
461+
stageName: 'Deploy',
462462
actions: [deployAction],
463463
});
464464
```
@@ -552,7 +552,7 @@ const lambdaAction = new codepipeline_actions.LambdaInvokeAction({
552552
lambda: fn,
553553
});
554554
pipeline.addStage({
555-
actionName: 'Lambda',
555+
stageName: 'Lambda',
556556
actions: [lambdaAction],
557557
});
558558
```

packages/@aws-cdk/aws-codepipeline-actions/test/cloudformation/test.cloudformation-pipeline-actions.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export = {
3131
pollForSourceChanges: true,
3232
});
3333
pipeline.addStage({
34-
name: 'source',
34+
stageName: 'source',
3535
actions: [source]
3636
});
3737

@@ -51,7 +51,7 @@ export = {
5151
outputs: [buildOutput],
5252
});
5353
pipeline.addStage({
54-
name: 'build',
54+
stageName: 'build',
5555
actions: [buildAction],
5656
});
5757

@@ -63,7 +63,7 @@ export = {
6363
const stackName = 'BrelandsStack';
6464
const changeSetName = 'MyMagicalChangeSet';
6565
pipeline.addStage({
66-
name: 'prod',
66+
stageName: 'prod',
6767
actions: [
6868
new cpactions.CloudFormationCreateReplaceChangeSetAction({
6969
actionName: 'BuildChangeSetProd',
@@ -432,8 +432,8 @@ class TestFixture extends cdk.Stack {
432432
super();
433433

434434
this.pipeline = new codepipeline.Pipeline(this, 'Pipeline');
435-
this.sourceStage = this.pipeline.addStage({ name: 'Source' });
436-
this.deployStage = this.pipeline.addStage({ name: 'Deploy' });
435+
this.sourceStage = this.pipeline.addStage({ stageName: 'Source' });
436+
this.deployStage = this.pipeline.addStage({ stageName: 'Deploy' });
437437
this.repo = new Repository(this, 'MyVeryImportantRepo', { repositoryName: 'my-very-important-repo' });
438438
this.sourceOutput = new codepipeline.Artifact('SourceArtifact');
439439
const source = new cpactions.CodeCommitSourceAction({

packages/@aws-cdk/aws-codepipeline-actions/test/integ.cfn-template-from-repo.lit.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const source = new cpactions.CodeCommitSourceAction({
1919
pollForSourceChanges: true,
2020
});
2121
const sourceStage = {
22-
name: 'Source',
22+
stageName: 'Source',
2323
actions: [source],
2424
};
2525

@@ -28,7 +28,7 @@ const stackName = 'OurStack';
2828
const changeSetName = 'StagedChangeSet';
2929

3030
const prodStage = {
31-
name: 'Deploy',
31+
stageName: 'Deploy',
3232
actions: [
3333
new cpactions.CloudFormationCreateReplaceChangeSetAction({
3434
actionName: 'PrepareChanges',

packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const lambdaSourceAction = new codepipeline_actions.CodeCommitSourceAction({
3636
output: lambdaSourceOutput,
3737
});
3838
pipeline.addStage({
39-
name: 'Source',
39+
stageName: 'Source',
4040
actions: [cdkSourceAction, lambdaSourceAction],
4141
});
4242

@@ -107,13 +107,13 @@ const lambdaBuildAction = new codepipeline_actions.CodeBuildAction({
107107
});
108108

109109
pipeline.addStage({
110-
name: 'Build',
110+
stageName: 'Build',
111111
actions: [cdkBuildAction, lambdaBuildAction],
112112
});
113113

114114
// finally, deploy your Lambda Stack
115115
pipeline.addStage({
116-
name: 'Deploy',
116+
stageName: 'Deploy',
117117
actions: [
118118
new codepipeline_actions.CloudFormationCreateUpdateStackAction({
119119
actionName: 'Lambda_CFN_Deploy',

packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const stack = new cdk.Stack(app, 'aws-cdk-codepipeline-lambda');
1111

1212
const pipeline = new codepipeline.Pipeline(stack, 'Pipeline');
1313

14-
const sourceStage = pipeline.addStage({ name: 'Source' });
14+
const sourceStage = pipeline.addStage({ stageName: 'Source' });
1515
const bucket = new s3.Bucket(stack, 'PipelineBucket', {
1616
versioned: true,
1717
removalPolicy: cdk.RemovalPolicy.Destroy,
@@ -36,7 +36,7 @@ const lambdaFun = new lambda.Function(stack, 'LambdaFun', {
3636
handler: 'index.handler',
3737
runtime: lambda.Runtime.Nodejs810,
3838
});
39-
const lambdaStage = pipeline.addStage({ name: 'Lambda' });
39+
const lambdaStage = pipeline.addStage({ stageName: 'Lambda' });
4040
lambdaStage.addAction(new cpactions.LambdaInvokeAction({
4141
actionName: 'Lambda' ,
4242
lambda: lambdaFun,

packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-alexa-deploy.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ const sourceAction = new cpactions.S3SourceAction({
1919
bucketKey: 'key',
2020
});
2121
const sourceStage = {
22-
name: 'Source',
22+
stageName: 'Source',
2323
actions: [sourceAction],
2424
};
2525

2626
const deployStage = {
27-
name: 'Deploy',
27+
stageName: 'Deploy',
2828
actions: [
2929
new cpactions.AlexaSkillDeployAction({
3030
actionName: 'DeploySkill',

packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn-cross-region.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ new codepipeline.Pipeline(stack, 'MyPipeline', {
2929
artifactBucket: bucket,
3030
stages: [
3131
{
32-
name: 'Source',
32+
stageName: 'Source',
3333
actions: [sourceAction],
3434
},
3535
{
36-
name: 'CFN',
36+
stageName: 'CFN',
3737
actions: [
3838
new cpactions.CloudFormationCreateUpdateStackAction({
3939
actionName: 'CFN_Deploy',

packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn-wtih-action-role.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const sourceAction = new cpactions.S3SourceAction({
2121
output: sourceOutput,
2222
});
2323
const sourceStage = {
24-
name: 'Source',
24+
stageName: 'Source',
2525
actions: [sourceAction],
2626
};
2727

@@ -33,7 +33,7 @@ role.addToPolicy(new iam.PolicyStatement({
3333
resources: ['*']
3434
}));
3535
const cfnStage = {
36-
name: 'CFN',
36+
stageName: 'CFN',
3737
actions: [
3838
new cpactions.CloudFormationCreateUpdateStackAction({
3939
actionName: 'CFN_Deploy',

0 commit comments

Comments
 (0)