Skip to content

Commit

Permalink
fix(aws-codebuild): correctly set S3 path when using it as artifact. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
skinny85 authored Nov 5, 2018
1 parent d7ef2a5 commit f32cba9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
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

0 comments on commit f32cba9

Please sign in to comment.