Continuous integration and continuous delivery is a DevOps software development practice. With continuous integration, developers regularly merge code changes into a central repository, after which the system automatically runs build and test operations. Continuous integration usually refers to the build or integration phase of the software release process, requiring both automation components (such as CI or build services) and cultural components (such as learning to integrate frequently). The main goals of continuous integration are to discover and resolve defects faster, improve software quality, and reduce the time needed to validate and release new software updates.
With continuous delivery, the system can automatically prepare code changes for release to production. A pillar of modern application development, continuous delivery extends continuous integration by deploying all code changes to testing environments and/or production environments after the build phase. When properly implemented, developers will always have deployment-ready build artifacts that have passed standardized testing processes.
With continuous delivery, developers can automatically execute tests beyond unit tests, allowing them to validate application updates across multiple dimensions before deploying to customer environments. These tests may include UI testing, load testing, integration testing, API reliability testing, etc. This helps developers verify updates more comprehensively and identify issues early. With the cloud, developers can easily and efficiently automatically create and replicate multiple environments for testing, which was previously difficult to achieve on-premises.
Why Do You Need CI/CD?
In the past, developers on a team might work in isolation for extended periods, only merging their changes to the main branch after their work was completed. This made merging code changes difficult and time-consuming, and also caused errors to accumulate over long periods without being corrected. These factors made it more difficult to quickly deliver updates to customers.
Continuous Delivery vs Continuous Deployment
With continuous delivery, the system builds and tests every code change, then pushes it to a non-production testing environment or staging environment. There may be multiple parallel testing stages before production deployment. The difference between continuous delivery and continuous deployment is that manual approval is required to update to production. With continuous deployment, production happens automatically without explicit approval.
Continuous delivery enables automation of the entire software release process. Every committed revision triggers an automated process that builds, tests, and delivers updates. The final decision to deploy to actual production is triggered by the developer.
Continuous Delivery is Not Continuous Deployment
A misconception about continuous delivery is that every committed change is immediately applied to production after passing automated tests. However, the key to continuous delivery is not immediately applying every change to production, but ensuring every change is ready for production. Before deploying changes to production, a decision process can be implemented to ensure production deployment is authorized and reviewed. This decision can be made by a person, then executed by tools.
With continuous delivery, the decision to go live becomes a business decision, not a technical decision. Technical validation happens with every commit. Releasing changes to production is not a disruptive event. Deployment doesn't require the technical team to stop working on the next set of changes, nor does it require project plans, handover documents, or maintenance windows. Deployment becomes a repeatable process that has been executed and validated multiple times in testing environments.
Benefits of Continuous Integration and Continuous Delivery
- Automate Software Release Process
Continuous delivery enables your team to automatically build, test, and prepare code changes for release to production, making your software delivery more efficient and faster.
- Improve Developer Productivity
Continuous integration frees developers from manual tasks and encourages behaviors that help reduce the number of errors and defects released to customer environments, thereby improving team productivity.
- Find and Resolve Defects Faster
Through more frequent testing, your team can discover and resolve defects before they become bigger problems later.
Continuous integration helps your team deliver updates to customers faster and more frequently.