Continuous Integration and Deployment Processes

The practice of Continuous Integration ensures that code is constantly merged and tested, allowing a team of developers to share work and find issues early in the process. Continuous Deployment enables the business to constantly deliver features, capture customer feedback, and adjust accordingly. Various engineering practices facilitate the two: TDD, proper branching models, workflows and VCS best practices. 

Without covering the details of a specific branching model, the below diagram gives an overview of a Continuous Integration process:

The image above, shows the following steps:

  1. Developer A and B work on separate branches at the same time.
  2. Once a unit of work is ready (i.e.: a function, or class method), it gets merged into the main branch.
  3. Automated tests are run. If a test fails, developers are notified.
  4. Main branch is merged in each developer’s branch, thus work being shared.

And an overview of a Continuous Deployment scenario:

The image above, shows the following steps:

  1. Code is merged and tested.
  2. Automated build is triggered.
  3. Code is deployed to Production or Staging servers automatically.

NOTE: In some scenarios code reviews are required. Different strategies can be used, such as using pull requests, or review requests; however, these are not the main focus on this tutorial.

To facilitate the above processes, Jenkins defines test and build tasks, while Capistrano deployed code across servers, using Git. Hook scripts can be configured to automatically trigger these tasks, however this tutorial focuses on the manual process.