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:
- Developer A and B work on separate branches at the same time.
- Once a unit of work is ready (i.e.: a function, or class method), it gets merged into the main branch.
- Automated tests are run. If a test fails, developers are notified.
- Main branch is merged in each developer’s branch, thus work being shared.
- Code is merged and tested.
- Automated build is triggered.
- Code is deployed to Production or Staging servers automatically.