Skip to content

Commit

Permalink
feat: Developer Preview of CDK Pipelines (#8868)
Browse files Browse the repository at this point in the history
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*
  • Loading branch information
rix0rrr committed Jul 8, 2020
1 parent 84b923f commit d2609bd
Show file tree
Hide file tree
Showing 40 changed files with 5,990 additions and 25 deletions.
53 changes: 30 additions & 23 deletions packages/@aws-cdk/aws-codepipeline-actions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline';
import * as codepipeline_actions from '@aws-cdk/aws-codepipeline-actions';
```

### Sources
## Sources

#### AWS CodeCommit
### AWS CodeCommit

To use a CodeCommit Repository in a CodePipeline:

Expand Down Expand Up @@ -62,7 +62,14 @@ new codepipeline_actions.CodeBuildAction({
});
```

#### GitHub
### GitHub

If you want to use a GitHub repository as the source, you must create:

* A [GitHub Access Token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line)
* A [Secrets Manager PlainText Secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/manage_create-basic-secret.html)
with the value of the **GitHub Access Token**. Pick whatever name you want
(for example `my-github-token`) and pass it as the argument of `oauthToken`.

To use GitHub as the source of a CodePipeline:

Expand Down Expand Up @@ -104,7 +111,7 @@ new codepipeline_actions.CodeBuildAction({
});
```

#### BitBucket
### BitBucket

CodePipeline can use a BitBucket Git repository as a source:

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

#### AWS S3
### AWS S3

To use an S3 Bucket as a source in CodePipeline:

Expand Down Expand Up @@ -205,7 +212,7 @@ new codepipeline_actions.CodeBuildAction({
});
```

#### AWS ECR
### AWS ECR

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

Expand Down Expand Up @@ -246,9 +253,9 @@ new codepipeline_actions.CodeBuildAction({
});
```

### Build & test
## Build & test

#### AWS CodeBuild
### AWS CodeBuild

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

Expand Down Expand Up @@ -301,7 +308,7 @@ const testAction = new codepipeline_actions.CodeBuildAction({
});
```

##### Multiple inputs and outputs
#### Multiple inputs and outputs

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

##### Variables
#### Variables

The CodeBuild action emits variables.
Unlike many other actions, the variables are not static,
Expand All @@ -399,7 +406,7 @@ const buildAction = new codepipeline_actions.CodeBuildAction({
build: {
commands: 'export MY_VAR="some value"',
},
},
},
}),
}),
variablesNamespace: 'MyNamespace', // optional - by default, a name will be generated for you
Expand All @@ -417,7 +424,7 @@ new codepipeline_actions.CodeBuildAction({
});
```

#### Jenkins
### Jenkins

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

### Deploy
## Deploy

#### AWS CloudFormation
### AWS CloudFormation

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

Expand Down Expand Up @@ -497,7 +504,7 @@ using a CloudFormation CodePipeline Action. Example:

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

##### Cross-account actions
#### Cross-account actions

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

#### AWS CodeDeploy
### AWS CodeDeploy

##### Server deployments
#### Server deployments

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

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

#### ECS
### ECS

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

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

#### AWS S3
### AWS S3

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

Expand All @@ -636,7 +643,7 @@ const deployStage = pipeline.addStage({
});
```

#### Alexa Skill
### Alexa Skill

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

Expand Down Expand Up @@ -687,9 +694,9 @@ new codepipeline_actions.AlexaSkillDeployAction({
});
```

### Approve & invoke
## Approve & invoke

#### Manual approval Action
### Manual approval Action

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

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

#### AWS Lambda
### AWS Lambda

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

Expand Down
3 changes: 3 additions & 0 deletions packages/@aws-cdk/pipelines/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const baseConfig = require('cdk-build-tools/config/eslintrc');
baseConfig.parserOptions.project = __dirname + '/tsconfig.json';
module.exports = baseConfig;
16 changes: 16 additions & 0 deletions packages/@aws-cdk/pipelines/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
*.js
tsconfig.json
*.js.map
*.d.ts
*.generated.ts
dist
lib/generated/resources.ts
.jsii

.LAST_BUILD
.nyc_output
coverage
nyc.config.js
.LAST_PACKAGE
*.snk
!.eslintrc.js
24 changes: 24 additions & 0 deletions packages/@aws-cdk/pipelines/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Don't include original .ts files when doing `npm pack`
*.ts
!*.d.ts
coverage
.nyc_output
*.tgz

dist
.LAST_PACKAGE
.LAST_BUILD
!*.js

# Include .jsii
!.jsii

*.snk

*.tsbuildinfo

tsconfig.json
.eslintrc.js

# exclude cdk artifacts
**/cdk.out
Loading

0 comments on commit d2609bd

Please sign in to comment.