Skip to content

Commit d2609bd

Browse files
authored
feat: Developer Preview of CDK Pipelines (#8868)
Adds an initial, Developer Preview version of CDK Pipelines, a higher-level construct library to make it easy to set up CI/CD pipelines for CDK apps. Resolves aws/aws-cdk-rfcs#49. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 84b923f commit d2609bd

40 files changed

+5990
-25
lines changed

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

+30-23
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline';
1414
import * as codepipeline_actions from '@aws-cdk/aws-codepipeline-actions';
1515
```
1616

17-
### Sources
17+
## Sources
1818

19-
#### AWS CodeCommit
19+
### AWS CodeCommit
2020

2121
To use a CodeCommit Repository in a CodePipeline:
2222

@@ -62,7 +62,14 @@ new codepipeline_actions.CodeBuildAction({
6262
});
6363
```
6464

65-
#### GitHub
65+
### GitHub
66+
67+
If you want to use a GitHub repository as the source, you must create:
68+
69+
* A [GitHub Access Token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line)
70+
* A [Secrets Manager PlainText Secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/manage_create-basic-secret.html)
71+
with the value of the **GitHub Access Token**. Pick whatever name you want
72+
(for example `my-github-token`) and pass it as the argument of `oauthToken`.
6673

6774
To use GitHub as the source of a CodePipeline:
6875

@@ -104,7 +111,7 @@ new codepipeline_actions.CodeBuildAction({
104111
});
105112
```
106113

107-
#### BitBucket
114+
### BitBucket
108115

109116
CodePipeline can use a BitBucket Git repository as a source:
110117

@@ -135,7 +142,7 @@ const sourceAction = new codepipeline_actions.BitBucketSourceAction({
135142
the above class `BitBucketSourceAction` is experimental -
136143
we reserve the right to make breaking changes to it.
137144

138-
#### AWS S3
145+
### AWS S3
139146

140147
To use an S3 Bucket as a source in CodePipeline:
141148

@@ -205,7 +212,7 @@ new codepipeline_actions.CodeBuildAction({
205212
});
206213
```
207214

208-
#### AWS ECR
215+
### AWS ECR
209216

210217
To use an ECR Repository as a source in a Pipeline:
211218

@@ -246,9 +253,9 @@ new codepipeline_actions.CodeBuildAction({
246253
});
247254
```
248255

249-
### Build & test
256+
## Build & test
250257

251-
#### AWS CodeBuild
258+
### AWS CodeBuild
252259

253260
Example of a CodeBuild Project used in a Pipeline, alongside CodeCommit:
254261

@@ -301,7 +308,7 @@ const testAction = new codepipeline_actions.CodeBuildAction({
301308
});
302309
```
303310

304-
##### Multiple inputs and outputs
311+
#### Multiple inputs and outputs
305312

306313
When you want to have multiple inputs and/or outputs for a Project used in a
307314
Pipeline, instead of using the `secondarySources` and `secondaryArtifacts`
@@ -375,7 +382,7 @@ const project = new codebuild.PipelineProject(this, 'MyProject', {
375382
});
376383
```
377384

378-
##### Variables
385+
#### Variables
379386

380387
The CodeBuild action emits variables.
381388
Unlike many other actions, the variables are not static,
@@ -399,7 +406,7 @@ const buildAction = new codepipeline_actions.CodeBuildAction({
399406
build: {
400407
commands: 'export MY_VAR="some value"',
401408
},
402-
},
409+
},
403410
}),
404411
}),
405412
variablesNamespace: 'MyNamespace', // optional - by default, a name will be generated for you
@@ -417,7 +424,7 @@ new codepipeline_actions.CodeBuildAction({
417424
});
418425
```
419426

420-
#### Jenkins
427+
### Jenkins
421428

422429
In order to use Jenkins Actions in the Pipeline,
423430
you first need to create a `JenkinsProvider`:
@@ -459,9 +466,9 @@ const buildAction = new codepipeline_actions.JenkinsAction({
459466
});
460467
```
461468

462-
### Deploy
469+
## Deploy
463470

464-
#### AWS CloudFormation
471+
### AWS CloudFormation
465472

466473
This module contains Actions that allows you to deploy to CloudFormation from AWS CodePipeline.
467474

@@ -497,7 +504,7 @@ using a CloudFormation CodePipeline Action. Example:
497504

498505
[Example of deploying a Lambda through CodePipeline](test/integ.lambda-deployed-through-codepipeline.lit.ts)
499506

500-
##### Cross-account actions
507+
#### Cross-account actions
501508

502509
If you want to update stacks in a different account,
503510
pass the `account` property when creating the action:
@@ -534,9 +541,9 @@ new codepipeline_actions.CloudFormationCreateUpdateStackAction({
534541
});
535542
```
536543

537-
#### AWS CodeDeploy
544+
### AWS CodeDeploy
538545

539-
##### Server deployments
546+
#### Server deployments
540547

541548
To use CodeDeploy for EC2/on-premise deployments in a Pipeline:
542549

@@ -589,7 +596,7 @@ where you will define your Pipeline,
589596
and deploy the `lambdaStack` using a CloudFormation CodePipeline Action
590597
(see above for a complete example).
591598

592-
#### ECS
599+
### ECS
593600

594601
CodePipeline can deploy an ECS service.
595602
The deploy Action receives one input Artifact which contains the [image definition file]:
@@ -616,7 +623,7 @@ const deployStage = pipeline.addStage({
616623

617624
[image definition file]: https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-create.html#pipelines-create-image-definitions
618625

619-
#### AWS S3
626+
### AWS S3
620627

621628
To use an S3 Bucket as a deployment target in CodePipeline:
622629

@@ -636,7 +643,7 @@ const deployStage = pipeline.addStage({
636643
});
637644
```
638645

639-
#### Alexa Skill
646+
### Alexa Skill
640647

641648
You can deploy to Alexa using CodePipeline with the following Action:
642649

@@ -687,9 +694,9 @@ new codepipeline_actions.AlexaSkillDeployAction({
687694
});
688695
```
689696

690-
### Approve & invoke
697+
## Approve & invoke
691698

692-
#### Manual approval Action
699+
### Manual approval Action
693700

694701
This package contains an Action that stops the Pipeline until someone manually clicks the approve button:
695702

@@ -712,7 +719,7 @@ but `notifyEmails` were,
712719
a new SNS Topic will be created
713720
(and accessible through the `notificationTopic` property of the Action).
714721

715-
#### AWS Lambda
722+
### AWS Lambda
716723

717724
This module contains an Action that allows you to invoke a Lambda function in a Pipeline:
718725

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const baseConfig = require('cdk-build-tools/config/eslintrc');
2+
baseConfig.parserOptions.project = __dirname + '/tsconfig.json';
3+
module.exports = baseConfig;
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
*.js
2+
tsconfig.json
3+
*.js.map
4+
*.d.ts
5+
*.generated.ts
6+
dist
7+
lib/generated/resources.ts
8+
.jsii
9+
10+
.LAST_BUILD
11+
.nyc_output
12+
coverage
13+
nyc.config.js
14+
.LAST_PACKAGE
15+
*.snk
16+
!.eslintrc.js
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Don't include original .ts files when doing `npm pack`
2+
*.ts
3+
!*.d.ts
4+
coverage
5+
.nyc_output
6+
*.tgz
7+
8+
dist
9+
.LAST_PACKAGE
10+
.LAST_BUILD
11+
!*.js
12+
13+
# Include .jsii
14+
!.jsii
15+
16+
*.snk
17+
18+
*.tsbuildinfo
19+
20+
tsconfig.json
21+
.eslintrc.js
22+
23+
# exclude cdk artifacts
24+
**/cdk.out

0 commit comments

Comments
 (0)