Blue/Green Deployment for Autoscaling Groups with CodePipeline, CodeBuild and CodeDeploy (Part 6/7)
In this 7-parts tutorial we will create an initial environment composed by an autoscaling group with two ubuntu machines behind a load balancer, then we will create a CI/CD pipeline to provide blue/green deployments using CodeBuild, CodeDeploy and CodePipeline.
Step 6: Configure CodePipeline
In this section we will put all together by creating a pipeline to automate all the process
About CodePipeline
AWS CodePipeline is a continuous integration and continuous delivery service for fast and reliable application and infrastructure updates. CodePipeline builds, tests, and deploys your code every time there is a code change, based on the release process models you define. This enables you to rapidly and reliably deliver features and updates.
Configure CodeDeploy
Browse to “Pipelines” (under Pipeline) in the CodePipeline portal and click on “Create pipeline”
Configure the pipeline settings with the details below:
- Pipeline name: bluegreen-pipeline
- Service Role: New service role
- Role name: bluegreen-codepipeline-role
Under “Source” configure the pipeline to retrieve the source code from your github repository and use github webhooks
Set the build provider as CodeBuild and use the project “bluegreen-build”
Configure the deployment to use the application “bluegreen-deploy” and the group “bluegreen-deploygroup”
Review the pipeline configuration and click on “Create pipeline”
Finally, the pipeline will be automatically triggered
Wait until the pipeline finish and browse to the load balancer dns (note that the build id appear in the page)