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

fix(aws-codebuild): correctly set S3 path when using it as artifact #1072

Merged
merged 1 commit into from
Nov 5, 2018
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
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-codebuild/lib/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class S3BucketBuildArtifacts extends BuildArtifacts {
return {
type: 'S3',
location: this.props.bucket.bucketName,
path: this.props.bucket.path,
path: this.props.path,
namespaceType: this.parseNamespaceType(this.props.includeBuildID),
name: this.props.name,
packaging: this.parsePackaging(this.props.packageZip),
Expand Down
22 changes: 22 additions & 0 deletions packages/@aws-cdk/aws-codebuild/test/test.codebuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,28 @@ export = {
}
},

'using path in S3 artifacts sets it correctly'(test: Test) {
const stack = new cdk.Stack();
const bucket = new s3.Bucket(stack, 'Bucket');
new codebuild.Project(stack, 'Project', {
artifacts: new codebuild.S3BucketBuildArtifacts({
path: 'some/path',
name: 'some_name',
bucket,
}),
});

expect(stack).to(haveResource('AWS::CodeBuild::Project', {
"Artifacts": {
"Path": "some/path",
"Name": "some_name",
"Type": "S3",
},
}));

test.done();
},

'artifacts': {
'CodePipeline': {
'both source and artifacs are set to CodePipeline'(test: Test) {
Expand Down