Skip to content

Instantly share code, notes, and snippets.

@JelsB
Last active January 10, 2021 19:49
Show Gist options
  • Save JelsB/cff41685f12613d23a00951ce1531dbb to your computer and use it in GitHub Desktop.
Save JelsB/cff41685f12613d23a00951ce1531dbb to your computer and use it in GitHub Desktop.
export class PipelineStack extends Stack {
// ...
const applicationCode = new Artifact('application')
const synthAction = SimpleSynthAction.standardNpmSynth({
// ...
buildCommand: 'npm run build',
subdirectory: 'infrastructure',
additionalArtifacts: [
{
directory: '../code/target-dir-with-build-output',
artifact: applicationCode
}]
})
const pipeline = new pipelines.CdkPipeline(this, 'pipeline', {
// ...
synthAction
})
// ...
// S3 bucket with name 'bucket-name' will be deployed in this stage
const spikeBucket = new BucketStage(this, 'spike-bucket', spikeProps)
const spikeBucketStage = pipeline.addApplicationStage(spikeBucket)
// Deploy build application code to S3
const deployCodeToS3 = new S3DeployAction({
actionName: 'deployCode',
bucket: s3.Bucket.fromBucketName(this, 'deploy-bucket', 'bucket-name'),
input: applicationCode
})
spikeBucketStage.addActions(deployCodeToS3)
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment