Creating our deployment pipeline with CodePipeline

We will use the AWS CodePipeline to build a pipeline very similar to the one we created in Chapter 4, Adding Continuous Integration and Continuous Deployment:


We will start with a Source step, where we will connect to GitHub and trigger new pipelines that run automatically when the code changes. Next, we will build a new container, and push it to our ecr repository, relying on the CodeBuild project we just created. We will then deploy the new container to staging. To do that, we will use the CloudFormation integration provided by CodePipeline, combined with the build.json file produced in the buildspec section of our CodeBuild project. You may recall that our helloworld service templates take the tag to deploy as an argument. We will trigger a stack update action and override the default value for that parameter with what's defined in the build.json file. After that, we will add a manual approval step before triggering the same deployment again, but this time, for production.

Deploying and updating CloudFormation templates through CodePipeline will require specifying the location of the template within the inputs. In order to easily provide it, we will first start by adding the CloudFormation template to our source.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset