code for article pfeilbr/aws-delivlib-playground
learn aws-delivlib, which is a library that leverages AWS Cloud Development Kit (CDK) for defining continuous pipelines for building, testing and publishing code libraries through AWS CodeBuild and AWS CodePipeline.
- pipeline source github repo must exist. (e.g. pfeilbr/aws-delivlib-playground)
- github personal access token must be stored in SSM Parameter named
src/pipeline-hello-world is an example code pipeline where the source is this github repo (pfeilbr/aws-delivlib-playground). The source nodejs app is
src/hello-world with jest tests.
source -> build -> test (linux) -> test (windows)
If any of the tests (
src/pipeline-hello-world/tests/change, be sure to do a
npm run build && npm run cdk deploy. Internally uses
mkdir -p src/pipeline-hello-world cd src/pipeline-hello-world cdk init --language typescript # at this time, `aws-delivlib` is not using the most recent version of CDK # need to do the following # see https://github.com/aws/aws-cdk/issues/1733 npm remove aws-cdk @aws-cdk/core aws-delivlib npm i email@example.com -D npm i @firstname.lastname@example.org npm i aws-delivlib # for dev npm run watch # build npm run build # generate cfn to stdout npm run cdk synth # deploy stack npm run cdk deploy # make changes # build npm run build # diff npm run cdk diff # delete stack npm run cdk destroy
AWS Console | CodePipeline
AWS Console | CloudFormation Stack
Twitter • Reddit