Skip to content

Commit

Permalink
Update the aws-codepipeline package ReadMe.
Browse files Browse the repository at this point in the history
  • Loading branch information
skinny85 committed Aug 3, 2018
1 parent 50ae056 commit 21e1c29
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 21 deletions.
46 changes: 29 additions & 17 deletions packages/@aws-cdk/aws-codepipeline/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,41 @@
## AWS CodePipeline construct library
## AWS CodePipeline Construct library

Construct an empty pipeline:
This library allows you to construct AWS CodePipelines.
A Pipeline is modeled like other CDK Constructs:
they form a tree, with Pipeline at the root.
Stages then take a Pipeline as their parent,
and finally Actions take a Stage as their parent.

Example:

```ts
const pipeline = new Pipeline(this, 'MyFirstPipeline');
import codepipeline = require('@aws-cdk/aws-codepipeline');

const pipeline = new codepipeline.Pipeline(this, 'MyFirstPipeline', {
pipelineName: 'MyFirstPipeline',
});
const stage = new codepipeline.Stage(pipeline, 'Source');
new codepipeline.GithubSource(stage, 'GitHub Source', {
artifactName: 'SourceArtifact',
owner: 'awslabs',
repo: 'aws-cdk',
oauthToken: new SecretParameter(//...
})
```
All of the components of a pipeline are modeled as constructs.
### Actions
Append a stage to the pipeline:
Actions are organized as follows.
```ts
const sourceStage = new Stage(pipeline, 'Source');
```
The most popular Actions for external integrations
(like a GitHub source, a Jenkins build and test, etc.)
are placed in this, `aws-codepipeline`, package.
Add an action to a stage:
The integrations with AWS services all live in their dedicated packages, so:
```ts
new codecommitPipeline.SourceAction(sourceStage, 'source', {
artifactName: 'MyPackageSourceArtifact',
repository: codecommit.RepositoryRef.import(this, 'MyExistingRepository', {
repositoryName: new codecommit.RepositoryName('MyExistingRepository'),
}),
})
```
* [`aws-codecommit-codepipeline`](../aws-codecommit-codepipeline) contains the AWS CodeCommit source Action
* [`aws-codebuild-codepipeline`](../aws-codebuild-codepipeline) contains the AWS CodeBuild build and test Actions
* [`aws-lambda-codepipeline`](../aws-lambda-codepipeline) contains the AWS Lambda invoke Action
### Events
Expand Down
10 changes: 6 additions & 4 deletions packages/@aws-cdk/aws-codepipeline/lib/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ export interface ActionProps {

/**
* Low level class for generically creating pipeline actions.
* It is recommended that concrete types are used instead, such as {@link codecommit.SourceAction} or
* {@link codebuild.BuildAction}.
* It is recommended that concrete types are used instead,
* such as {@link codecommitPipeline.SourceAction} or
* {@link codebuildPipeline.BuildAction}.
*/
export abstract class Action extends cdk.Construct {
/**
Expand Down Expand Up @@ -243,7 +244,7 @@ export interface SourceProps {
/**
* Low level class for source actions.
* It is recommended that concrete types are used instead, such as {@link AmazonS3Source} or
* {@link codecommit.SourceAction}.
* {@link codecommitPipeline.SourceAction}.
*/
export abstract class Source extends Action {
public readonly artifact: Artifact;
Expand Down Expand Up @@ -408,7 +409,8 @@ export interface BuildActionProps {

/**
* Low level class for build actions.
* It is recommended that concrete types are used instead, such as {@link codebuild.BuildAction}.
* It is recommended that concrete types are used instead,
* such as {@link codebuildPipeline.BuildAction}.
*/
export abstract class BuildAction extends Action {
public readonly artifact?: Artifact;
Expand Down

0 comments on commit 21e1c29

Please sign in to comment.