Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(codebuild): add filter groups feature for GitHub, GitHubEnterpri… #2319

Merged
merged 2 commits into from
May 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/@aws-cdk/aws-codebuild/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ Example:
const gitHubSource = new codebuild.GitHubSource({
owner: 'awslabs',
repo: 'aws-cdk',
webhook: true, // optional, default: false
webhook: true, // optional, default: true if `webhookFilteres` were provided, false otherwise
webhookFilters: [
codebuild.FilterGroup.inEventOf(codebuild.EventAction.PUSH).andBranchIs('master'),
], // optional, by default all pushes and Pull Requests will trigger a build
});
```

Expand Down Expand Up @@ -283,4 +286,4 @@ new Project(stack, 'MyProject', {
securityGroups: [securityGroup],
vpc: vpc
});
```
```
10 changes: 5 additions & 5 deletions packages/@aws-cdk/aws-codebuild/lib/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ export class Project extends ProjectBase {
throw new Error(`Badge is not supported for source type ${this.source.type}`);
}

const sourceJson = this.source.toSourceJSON();
const sourceJson = this.source._toSourceJSON();
if (typeof buildSpec === 'string') {
return {
...sourceJson,
Expand Down Expand Up @@ -670,7 +670,7 @@ export class Project extends ProjectBase {
timeoutInMinutes: props.timeout,
secondarySources: new Token(() => this.renderSecondarySources()),
secondaryArtifacts: new Token(() => this.renderSecondaryArtifacts()),
triggers: this.source.buildTriggers(),
triggers: this.source._buildTriggers(),
vpcConfig: this.configureVpc(props),
});

Expand Down Expand Up @@ -822,7 +822,7 @@ export class Project extends ProjectBase {
private renderSecondarySources(): CfnProject.SourceProperty[] | undefined {
return this._secondarySources.length === 0
? undefined
: this._secondarySources.map((secondarySource) => secondarySource.toSourceJSON());
: this._secondarySources.map((secondarySource) => secondarySource._toSourceJSON());
}

private renderSecondaryArtifacts(): CfnProject.ArtifactsProperty[] | undefined {
Expand Down Expand Up @@ -889,15 +889,15 @@ export class Project extends ProjectBase {
if (props.artifacts) {
return props.artifacts;
}
if (this.source.toSourceJSON().type === CODEPIPELINE_TYPE) {
if (this.source._toSourceJSON().type === CODEPIPELINE_TYPE) {
return new CodePipelineBuildArtifacts();
} else {
return new NoBuildArtifacts();
}
}

private validateCodePipelineSettings(artifacts: BuildArtifacts) {
const sourceType = this.source.toSourceJSON().type;
const sourceType = this.source._toSourceJSON().type;
const artifactsType = artifacts.toArtifactsJSON().type;

if ((sourceType === CODEPIPELINE_TYPE || artifactsType === CODEPIPELINE_TYPE) &&
Expand Down
Loading