This repo creates a fully managed AWS CodePipeline that automatically builds and deploys everytime code is committed to GitHub.
Here is an example application using this template: https://github.com/MatthewSilverstein/serverless-java
Source (GitHub)
-----↓-----
Build (CodeBuild)
-----↓-----
Deploy Alpha (CodeBuild)
-----↓-----
Integration Test Alpha (CodeBuild)
-----↓-----
Deploy Beta (CodeBuild)
- Install awscli and setup aws account
- Create a GitHub repository
- Get an access key for GitHub repository with privilleges: [admin:repo_hook, repo]
- In commandline:
aws cloudformation deploy --template-file cloudformation-pipeline.yaml --stack-name <stack-name> --capabilities CAPABILITY_NAMED_IAM --parameter-overrides \
GitHubUser=<username> \
Repo=<repo> \
Branch=<branch> \
GitHubToken=<github access token>
By default, there are three buildspec files used by this pipeline:
- buildspec-build.yml: This is used by the Build phase of the pipeline
- buildspec-deploy.yml: This is used by the Deployment phases of the pipeline
- buildspec-integration-tests.yml: This is used by the Integration Test phase