Setting up a Deployment Project with Capistrano & Chef-Solo on AWS

Originally posted on CharlesGreen.org

As SCORE grows in size and scope it got me thinking that we really should put an overall deployment process in place. No only will this help to include deployment as part of the overall development process but also it will help to speedup the overall development process while ensuring that deployment is rock solid for even the first release.

Infrastructure Deployment

Coming from a development background the “Infrastructure as Code” concept really makes sense. As such we will be using Amazon’s Ruby SDK and Cloud Formation to script and automate the process of hardware and OS provisioning on AWS. From there we will be using Chef-Solo to install and setup the environments needed to support our application. Lastly, we will be using Capistrano to deploy and version or application while bootstrapping the entire process from start to finish.

Infrastructure Provisioning Process:

  1. Start Capistrano Deployment Script on local system
  2. Capistrano will use SDK and Cloud Formation Templates to deploy new environment (EC2 Ubuntu instances, Load Balladeer, RDS PostgreSQL, etc.)
  3. Capistrano will use Chef-Solo to install and configure required applications on EC2 instances.

Continuous Deployment

In my opinion, one of the greatest challenges being faced by organizations is the is the time, energy, and speed of releasing new features, updates, and big fixes to their production systems. One of the many reasons for this is that in many companies development changes are grouped together and manually pushed through each phase. To address this we will be using the concept of automated deployment while following many of the principles from Continuous Delivery.

SCORE Deployment Process:

  1. A change is submitted as a Pull Request on GitHub
  2. The commit is reviewed and either accepted or rejected
  3. If accepted the Pull Request will be merged and automatically submitted to Travis CI for automated testing.
  4. If all tests are passed the updated code will be automatically pushed to Amazon S3.
  5. A deployment script will monitor the bucket and automatically launch new server instances with the update SCORE package.
  6. The deployment script will then run a set of health checks on the services.
  7. If all health checks pass the updated services will be added to the load balancer and the outdated servers will be retired.

Basic Deployment Overview



Recent Posts: