Skip to content

Commit

Permalink
Use only pipeline projects for CodeBuild
Browse files Browse the repository at this point in the history
  • Loading branch information
clareliguori committed Oct 21, 2019
1 parent 1f77b5c commit 90f9e8b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 22 deletions.
12 changes: 2 additions & 10 deletions pipelines/src/api-service-pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ class TriviaGameBackendPipelineStack extends cdk.Stack {
});

// Build
const buildProject = new codebuild.Project(this, 'BuildProject', {
source: codebuild.Source.gitHub({
owner: 'aws-samples',
repo: 'aws-reinvent-2018-trivia-game'
}),
const buildProject = new codebuild.PipelineProject(this, 'BuildProject', {
buildSpec: codebuild.BuildSpec.fromSourceFilename('trivia-backend/infra/cdk/buildspec.yml'),
environment: {
buildImage: codebuild.LinuxBuildImage.UBUNTU_14_04_NODEJS_10_1_0,
Expand All @@ -54,11 +50,7 @@ class TriviaGameBackendPipelineStack extends cdk.Stack {
}
},
privileged: true
},
artifacts: codebuild.Artifacts.s3({
bucket: pipeline.artifactBucket,
name: 'output.zip'
})
}
});

buildProject.addToRolePolicy(new iam.PolicyStatement({
Expand Down
12 changes: 2 additions & 10 deletions pipelines/src/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ export class TriviaGameCfnPipeline extends cdk.Construct {
this.sourceOutput = sourceOutput;

// Build
const buildProject = new codebuild.Project(this, 'BuildProject', {
source: codebuild.Source.gitHub({
owner: 'aws-samples',
repo: 'aws-reinvent-2018-trivia-game'
}),
const buildProject = new codebuild.PipelineProject(this, 'BuildProject', {
buildSpec: codebuild.BuildSpec.fromSourceFilename(props.directory + '/buildspec.yml'),
environment: {
buildImage: codebuild.LinuxBuildImage.UBUNTU_14_04_NODEJS_10_1_0,
Expand All @@ -55,11 +51,7 @@ export class TriviaGameCfnPipeline extends cdk.Construct {
}
},
privileged: true
},
artifacts: codebuild.Artifacts.s3({
bucket: pipeline.artifactBucket,
name: 'output.zip'
})
}
});

const buildArtifact = new codepipeline.Artifact('BuildArtifact');
Expand Down
5 changes: 3 additions & 2 deletions pipelines/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"inlineSourceMap": true,
"inlineSources": true,
"experimentalDecorators": true,
"strictPropertyInitialization":false
"strictPropertyInitialization":false,
"resolveJsonModule": true,
"esModuleInterop": true
}
}

0 comments on commit 90f9e8b

Please sign in to comment.