Adding Continuous Integration and Continuous Deployment

In the previous chapters, we focused on improving the creation and management of infrastructure, but a DevOps culture doesn't stop there. As you might recall from Chapter 1, The Cloud and the DevOps Revolution, some of the key characteristics of a DevOps culture also include having a very efficient process to test and deploy code. In 2009, at the Velocity conference, John Allspaw and Paul Hammond gave a very inspirational talk on how Flickr was making over 10 deployments a day (http://bit.ly/292ASlW). The presentation is often mentioned as a pivotal moment that contributed to the creation of the DevOps movement. In their presentation, John and Paul talk about the developers versus operations conflicts but also outline a number of best practices that allowed Flickr to deploy new code to production multiple times a day. With innovations like the cloud, creating new startups has never been so easy. Because of that, the biggest problem companies are now facing is being able to stand apart from their competitors. Having the ability to iterate faster than most competitors can become a detrimental step for a company's success. Effective DevOps organization uses a number of tools and strategies to increase the velocity at which engineering organizations release new code to production. This is what we will focus on in this chapter.

We will first look at creating a continuous integration (CI) pipeline. A CI pipeline will allow us to run our tests against proposed code changes automatically and continuously. This will free up some of the developers' and QAs' time, who won't have to do as much manual testing, and make the integration work a lot easier. To implement our pipeline, we will use GitHub and one of the most widely used integration tools, Jenkins.

We will then look at creating a continuous deployment (CD) pipeline. Once the code has gone through the CI pipeline, we will use this CD pipeline to deploy the new code automatically. We will rely on two AWS services, AWS CodeDeploy, and AWS CodePipeline to implement this pipeline. The first service, CodeDeploy, will let us define how the new code needs to be deployed on our EC2 instances, while AWS CodePipeline will let us orchestrate the full life cycle of our application.

In order to deploy our code to production, we will add an extra step that an operator can trigger with the push of a button to deploy the latest build present in staging to production. This ability to deploy code to production on-demand is called continuous delivery. Its main advantage is that it provides the ability for the deployment operator to validate a build in a staging environment before it gets deployed to production. At the end of the chapter, we will see a couple of techniques and strategies that effective engineering organizations use to convert their continuous delivery pipelines into continuous deployment pipelines so that the entire process of deploying code up to production can happen without any human intervention:

  • Building a continuous integration pipeline
  • Building a continuous deployment pipeline
..................Content has been hidden....................

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