Skip to content

Commit

Permalink
Rename asCodePipelineAction to toCodePipelineAction.
Browse files Browse the repository at this point in the history
  • Loading branch information
skinny85 committed Feb 6, 2019
1 parent ae8f10b commit 739da9d
Show file tree
Hide file tree
Showing 26 changed files with 52 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ function createSelfUpdatingStack(pipelineStack: cdk.Stack): SelfUpdatingPipeline
});

const project = new codebuild.PipelineProject(pipelineStack, 'CodeBuild');
const buildAction = project.asCodePipelineAction({
const buildAction = project.toCodePipelineBuildAction({
actionName: 'CodeBuild',
inputArtifact: sourceAction.outputArtifact,
});
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-codebuild/lib/pipeline-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface CommonCodeBuildActionProps {
/**
* Common properties for creating {@link PipelineBuildAction} -
* either directly, through its constructor,
* or through {@link IProject#asCodePipelineAction}.
* or through {@link IProject#toCodePipelineBuildAction}.
*/
export interface CommonPipelineBuildActionProps extends CommonCodeBuildActionProps,
codepipeline.CommonActionProps {
Expand Down Expand Up @@ -110,7 +110,7 @@ export class PipelineBuildAction extends codepipeline.BuildAction {
/**
* Common properties for creating {@link PipelineTestAction} -
* either directly, through its constructor,
* or through {@link IProject#asCodePipelineTestAction}.
* or through {@link IProject#toCodePipelineTestAction}.
*/
export interface CommonPipelineTestActionProps extends CommonCodeBuildActionProps,
codepipeline.CommonActionProps {
Expand Down
8 changes: 4 additions & 4 deletions packages/@aws-cdk/aws-codebuild/lib/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ export interface IProject extends cdk.IConstruct, events.IEventRuleTarget {
* @param props the construction properties of the new Action
* @returns the newly created {@link PipelineBuildAction CodeBuild build Action}
*/
asCodePipelineAction(props: CommonPipelineBuildActionProps): PipelineBuildAction;
toCodePipelineBuildAction(props: CommonPipelineBuildActionProps): PipelineBuildAction;

/**
* Convenience method for creating a new {@link PipelineTestAction CodeBuild test Action}.
*
* @param props the construction properties of the new Action
* @returns the newly created {@link PipelineBuildAction CodeBuild test Action}
*/
asCodePipelineTestAction(props: CommonPipelineTestActionProps): PipelineTestAction;
toCodePipelineTestAction(props: CommonPipelineTestActionProps): PipelineTestAction;

/**
* Defines a CloudWatch event rule triggered when the build project state
Expand Down Expand Up @@ -189,14 +189,14 @@ export abstract class ProjectBase extends cdk.Construct implements IProject {

public abstract export(): ProjectImportProps;

public asCodePipelineAction(props: CommonPipelineBuildActionProps): PipelineBuildAction {
public toCodePipelineBuildAction(props: CommonPipelineBuildActionProps): PipelineBuildAction {
return new PipelineBuildAction({
...props,
project: this,
});
}

public asCodePipelineTestAction(props: CommonPipelineTestActionProps): PipelineTestAction {
public toCodePipelineTestAction(props: CommonPipelineTestActionProps): PipelineTestAction {
return new PipelineTestAction({
...props,
project: this,
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-codecommit/lib/pipeline-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { IRepository } from './repository';
/**
* Common properties for creating {@link PipelineSourceAction} -
* either directly, through its constructor,
* or through {@link IRepository#asCodePipelineAction}.
* or through {@link IRepository#toCodePipelineSourceAction}.
*/
export interface CommonPipelineSourceActionProps extends codepipeline.CommonActionProps {
/**
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-codecommit/lib/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface IRepository extends cdk.IConstruct {
* @param props the construction properties of the new Action
* @returns the newly created {@link PipelineSourceAction}
*/
asCodePipelineAction(props: CommonPipelineSourceActionProps): PipelineSourceAction;
toCodePipelineSourceAction(props: CommonPipelineSourceActionProps): PipelineSourceAction;

/**
* Defines a CloudWatch event rule which triggers for repository events. Use
Expand Down Expand Up @@ -119,7 +119,7 @@ export abstract class RepositoryBase extends cdk.Construct implements IRepositor

public abstract export(): RepositoryImportProps;

public asCodePipelineAction(props: CommonPipelineSourceActionProps): PipelineSourceAction {
public toCodePipelineSourceAction(props: CommonPipelineSourceActionProps): PipelineSourceAction {
return new PipelineSourceAction({
...props,
repository: this,
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-codedeploy/lib/pipeline-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { IServerDeploymentGroup } from './server';
/**
* Common properties for creating a {@link PipelineDeployAction},
* either directly, through its constructor,
* or through {@link IServerDeploymentGroup#asCodePipelineAction}.
* or through {@link IServerDeploymentGroup#toCodePipelineDeployAction}.
*/
export interface CommonPipelineDeployActionProps extends codepipeline.CommonActionProps {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export interface IServerDeploymentGroup extends cdk.IConstruct {
* @param props the construction properties of the new Action
* @returns the newly created {@link PipelineDeployAction} deploy Action
*/
asCodePipelineAction(props: CommonPipelineDeployActionProps): PipelineDeployAction;
toCodePipelineDeployAction(props: CommonPipelineDeployActionProps): PipelineDeployAction;
}

/**
Expand Down Expand Up @@ -82,7 +82,7 @@ export abstract class ServerDeploymentGroupBase extends cdk.Construct implements

public abstract export(): ServerDeploymentGroupImportProps;

public asCodePipelineAction(props: CommonPipelineDeployActionProps):
public toCodePipelineDeployAction(props: CommonPipelineDeployActionProps):
PipelineDeployAction {
return new PipelineDeployAction({
...props,
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-codepipeline/lib/jenkins-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface BasicJenkinsActionProps extends cpapi.CommonActionProps {
/**
* Common properties for creating {@link JenkinsBuildAction} -
* either directly, through its constructor,
* or through {@link IJenkinsProvider#asCodePipelineAction}.
* or through {@link IJenkinsProvider#toCodePipelineBuildAction}.
*/
export interface BasicJenkinsBuildActionProps extends BasicJenkinsActionProps {
/**
Expand Down Expand Up @@ -76,7 +76,7 @@ export class JenkinsBuildAction extends cpapi.BuildAction {
/**
* Common properties for creating {@link JenkinsTestAction} -
* either directly, through its constructor,
* or through {@link IJenkinsProvider#asCodePipelineTestAction}.
* or through {@link IJenkinsProvider#toCodePipelineTestAction}.
*/
export interface BasicJenkinsTestActionProps extends BasicJenkinsActionProps {
/**
Expand Down
8 changes: 4 additions & 4 deletions packages/@aws-cdk/aws-codepipeline/lib/jenkins-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface IJenkinsProvider extends cdk.IConstruct {
* @param props construction properties of the new Action
* @returns the newly created {@link JenkinsBuildAction}
*/
asCodePipelineAction(props: BasicJenkinsBuildActionProps):
toCodePipelineBuildAction(props: BasicJenkinsBuildActionProps):
JenkinsBuildAction;

/**
Expand All @@ -37,7 +37,7 @@ export interface IJenkinsProvider extends cdk.IConstruct {
* @param props construction properties of the new Action
* @returns the newly created {@link JenkinsTestAction}
*/
asCodePipelineTestAction(props: BasicJenkinsTestActionProps):
toCodePipelineTestAction(props: BasicJenkinsTestActionProps):
JenkinsTestAction;

/**
Expand Down Expand Up @@ -143,14 +143,14 @@ export abstract class BaseJenkinsProvider extends cdk.Construct implements IJenk
};
}

public asCodePipelineAction(props: BasicJenkinsBuildActionProps): JenkinsBuildAction {
public toCodePipelineBuildAction(props: BasicJenkinsBuildActionProps): JenkinsBuildAction {
return new JenkinsBuildAction({
jenkinsProvider: this,
...props,
});
}

public asCodePipelineTestAction(props: BasicJenkinsTestActionProps): JenkinsTestAction {
public toCodePipelineTestAction(props: BasicJenkinsTestActionProps): JenkinsTestAction {
return new JenkinsTestAction({
jenkinsProvider: this,
...props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ const lambdaFun = new lambda.Function(stack, 'LambdaFun', {
runtime: lambda.Runtime.NodeJS610,
});
const lambdaStage = pipeline.addStage({ name: 'Lambda' });
lambdaStage.addAction(lambdaFun.asCodePipelineAction({ actionName: 'Lambda' }));
lambdaStage.addAction(lambdaFun.toCodePipelineInvokeAction({ actionName: 'Lambda' }));

app.run();
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const bucket = new s3.Bucket(stack, 'MyBucket', {
removalPolicy: cdk.RemovalPolicy.Destroy,
});

const sourceAction = bucket.asCodePipelineAction({
const sourceAction = bucket.toCodePipelineSourceAction({
actionName: 'S3',
bucketKey: 'some/path',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const bucket = new s3.Bucket(stack, 'MyBucket', {
removalPolicy: cdk.RemovalPolicy.Destroy,
});

const sourceAction = bucket.asCodePipelineAction({
const sourceAction = bucket.toCodePipelineSourceAction({
actionName: 'S3',
bucketKey: 'some/path',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ const pipeline = new codepipeline.Pipeline(stack, 'Pipeline', {
artifactBucket: bucket,
});

const sourceAction1 = repository.asCodePipelineAction({ actionName: 'Source1' });
const sourceAction2 = bucket.asCodePipelineAction({
const sourceAction1 = repository.toCodePipelineSourceAction({ actionName: 'Source1' });
const sourceAction2 = bucket.toCodePipelineSourceAction({
actionName: 'Source2',
bucketKey: 'some/path',
});
Expand All @@ -34,7 +34,7 @@ pipeline.addStage({
});

const project = new codebuild.PipelineProject(stack, 'MyBuildProject');
const buildAction = project.asCodePipelineAction({
const buildAction = project.toCodePipelineBuildAction({
actionName: 'Build1',
inputArtifact: sourceAction1.outputArtifact,
additionalInputArtifacts: [
Expand All @@ -44,7 +44,7 @@ const buildAction = project.asCodePipelineAction({
'CustomOutput1',
],
});
const testAction = project.asCodePipelineTestAction({
const testAction = project.toCodePipelineTestAction({
actionName: 'Build2',
inputArtifact: sourceAction2.outputArtifact,
additionalInputArtifacts: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ new codepipeline.Pipeline(stack, 'Pipeline', {
{
name: 'source',
actions: [
repo.asCodePipelineAction({
repo.toCodePipelineSourceAction({
actionName: 'source',
outputArtifactName: 'SourceArtifact',
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ const pipeline = new codepipeline.Pipeline(stack, 'Pipeline', {
});

const sourceStage = pipeline.addStage({ name: 'Source' });
const sourceAction = bucket.asCodePipelineAction({
const sourceAction = bucket.toCodePipelineSourceAction({
actionName: 'S3Source',
bucketKey: 'application.zip',
outputArtifactName: 'SourceOutput',
});
sourceStage.addAction(sourceAction);

const deployStage = pipeline.addStage({ name: 'Deploy' });
deployStage.addAction(deploymentGroup.asCodePipelineAction({
deployStage.addAction(deploymentGroup.toCodePipelineDeployAction({
actionName: 'CodeDeploy',
inputArtifact: sourceAction.outputArtifact,
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const pipeline = new codepipeline.Pipeline(stack, 'MyPipeline', {

const repository = new ecr.Repository(stack, 'MyEcrRepo');
const sourceStage = pipeline.addStage({ name: 'Source' });
sourceStage.addAction(repository.asCodePipelineAction({ actionName: 'ECR_Source' }));
sourceStage.addAction(repository.toCodePipelineSourceAction({ actionName: 'ECR_Source' }));

const approveStage = pipeline.addStage({ name: 'Approve' });
approveStage.addAction(new codepipeline.ManualApprovalAction({ actionName: 'ManualApproval' }));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const pipeline = new codepipeline.Pipeline(stack, 'Pipeline', {
artifactBucket: bucket,
});

const sourceAction = bucket.asCodePipelineAction({
const sourceAction = bucket.toCodePipelineSourceAction({
actionName: 'S3',
bucketKey: 'some/path',
});
Expand All @@ -32,17 +32,17 @@ const jenkinsProvider = new codepipeline.JenkinsProvider(stack, 'JenkinsProvider
pipeline.addStage({
name: 'Build',
actions: [
jenkinsProvider.asCodePipelineAction({
jenkinsProvider.toCodePipelineBuildAction({
actionName: 'JenkinsBuild',
projectName: 'JenkinsProject1',
inputArtifact: sourceAction.outputArtifact,
}),
jenkinsProvider.asCodePipelineTestAction({
jenkinsProvider.toCodePipelineTestAction({
actionName: 'JenkinsTest',
projectName: 'JenkinsProject2',
inputArtifact: sourceAction.outputArtifact,
}),
jenkinsProvider.asCodePipelineTestAction({
jenkinsProvider.toCodePipelineTestAction({
actionName: 'JenkinsTest2',
projectName: 'JenkinsProject3',
inputArtifact: sourceAction.outputArtifact,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ new codepipeline.Pipeline(stack, 'Pipeline', {
{
name: 'Deploy',
actions: [
deployBucket.asCodePipelineDeployAction({
deployBucket.toCodePipelineDeployAction({
actionName: 'DeployAction',
inputArtifact: sourceAction.outputArtifact,
}),
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-codepipeline/test/test.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export = {
const repo = new codecommit.Repository(stack, 'Repo', {
repositoryName: 'Repo',
});
const sourceAction = repo.asCodePipelineAction({ actionName: 'CodeCommit' });
const sourceAction = repo.toCodePipelineSourceAction({ actionName: 'CodeCommit' });
pipeline.addStage({
name: 'Source',
actions: [sourceAction],
Expand All @@ -79,7 +79,7 @@ export = {
pipeline.addStage({
name: 'Build',
actions: [
project.asCodePipelineAction({
project.toCodePipelineBuildAction({
actionName: 'CodeBuild',
inputArtifact: sourceAction.outputArtifact,
}),
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-codepipeline/test/test.pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,12 @@ export = {
const pipeline = new codepipeline.Pipeline(stack, 'Pipeline');

const bucket = new s3.Bucket(stack, 'Bucket');
const source1 = bucket.asCodePipelineAction({
const source1 = bucket.toCodePipelineSourceAction({
actionName: 'SourceAction1',
bucketKey: 'some/key',
outputArtifactName: 'sourceArtifact1',
});
const source2 = bucket.asCodePipelineAction({
const source2 = bucket.toCodePipelineSourceAction({
actionName: 'SourceAction2',
bucketKey: 'another/key',
outputArtifactName: 'sourceArtifact2',
Expand Down Expand Up @@ -467,7 +467,7 @@ export = {
},
});

const sourceAction = bucket.asCodePipelineAction({
const sourceAction = bucket.toCodePipelineSourceAction({
actionName: 'BucketSource',
bucketKey: '/some/key',
});
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-ecr/lib/pipeline-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { IRepository } from './repository-ref';
/**
* Common properties for the {@link PipelineSourceAction CodePipeline source Action},
* whether creating it directly,
* or through the {@link IRepository#asCodePipelineAction} method.
* or through the {@link IRepository#toCodePipelineSourceAction} method.
*/
export interface CommonPipelineSourceActionProps extends codepipeline.CommonActionProps {
/**
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-ecr/lib/repository-ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export interface IRepository extends cdk.IConstruct {
* @param props the construction properties of the new Action
* @returns the newly created {@link PipelineSourceAction}
*/
asCodePipelineAction(props: CommonPipelineSourceActionProps):
toCodePipelineSourceAction(props: CommonPipelineSourceActionProps):
PipelineSourceAction;

/**
Expand Down Expand Up @@ -169,7 +169,7 @@ export abstract class RepositoryBase extends cdk.Construct implements IRepositor
*/
public abstract export(): RepositoryImportProps;

public asCodePipelineAction(props: CommonPipelineSourceActionProps): PipelineSourceAction {
public toCodePipelineSourceAction(props: CommonPipelineSourceActionProps): PipelineSourceAction {
return new PipelineSourceAction({
...props,
repository: this,
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-lambda/lib/lambda-ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export interface IFunction extends cdk.IConstruct, events.IEventRuleTarget, logs
* @param props the construction properties of the new Action
* @returns the newly created {@link PipelineInvokeAction}
*/
asCodePipelineAction(props: CommonPipelineInvokeActionProps): PipelineInvokeAction;
toCodePipelineInvokeAction(props: CommonPipelineInvokeActionProps): PipelineInvokeAction;

addToRolePolicy(statement: iam.PolicyStatement): void;

Expand Down Expand Up @@ -193,7 +193,7 @@ export abstract class FunctionBase extends cdk.Construct implements IFunction {
return this.node.id;
}

public asCodePipelineAction(props: CommonPipelineInvokeActionProps): PipelineInvokeAction {
public toCodePipelineInvokeAction(props: CommonPipelineInvokeActionProps): PipelineInvokeAction {
return new PipelineInvokeAction({
...props,
lambda: this,
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda/lib/pipeline-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { IFunction } from './lambda-ref';
/**
* Common properties for creating a {@link PipelineInvokeAction} -
* either directly, through its constructor,
* or through {@link IFunction#asCodePipelineAction}.
* or through {@link IFunction#toCodePipelineInvokeAction}.
*/
export interface CommonPipelineInvokeActionProps extends codepipeline.CommonActionProps {
// because of @see links
Expand Down
Loading

0 comments on commit 739da9d

Please sign in to comment.