Continuous Integration and Continuous Delivery/Deployment (CI/CD) are software development practices that automatically integrate code changes into the main branch of a project at a high frequency. CI/CD helps improve software quality, enhance development efficiency, and shorten the release cycle.
CI/CD overview
Continuous Integration (CI):
CI is a development practice that requires developers to commit code changes to a shared code repository, such as Git, at a high frequency (in most cases, multiple times per day). Each commit triggers an automated process that includes code building, unit testing, and integration testing to ensure compatibility of the new code with the existing code repository.
Continuous Delivery/Deployment (CD):
Continuous Delivery: an extension of CI, which ensures that code is always in a ready-for-deployment state. Continuous Delivery automates the delivery of code changes to a production-like environment, such as a pre-release environment. However, the final deployment to the production environment requires manual approval.
Continuous Deployment: Compared with Continuous Delivery, Continuous Deployment fully automates the deployment of code changes to the production environment without any manual intervention.
Basic pipeline of CI/CD
Phase | Step | Key action | Example tool |
Code commit | Commit code to a repository. | The developer pushes code to a Git branch, such as | Git, GitHub, or GitLab |
CI pipeline | Trigger code building. | Listen for code changes and start the CI pipeline by using a tool, such as a webhook. | Jenkins or GitHub Actions |
Perform a static check for code. | Check code for specification issues and scan code for security issues by using a tool, such as ESLint or SonarQube. | SonarQube or ESLint | |
Automatically build code. | Compile code and package the code into an image or generate a binary file by running a command, such as | Maven, Docker, or Gradle | |
Automatically test code. | Perform unit tests, integration tests, and coverage checks by using a tool, such as JUnit or Selenium. | JUnit, Selenium, or pytest | |
Quality control | Verify the test results. | Check whether the code passes all tests. If the code fails a test, interrupt the process and notify the developer. | Jenkins Quality Gates |
Artifact generation | Generate a deployment package. | Archive or push the artifacts to a repository, such as Nexus or Docker Hub. | Nexus or Docker Hub |
CD pipeline | Deploy code to a test environment. | Automatically deploy code to a pre-release environment, such as a Kubernetes cluster. | Argo CD or Ansible |
Manually test and approve code. | The test team verifies the features and manually approves the deployment of the code to the production environment. | Manual trigger, such as manual approval by using Jenkins | |
Deploy code to the production environment. | Perform rolling updates or blue-green deployments to ensure high service availability. | Kubernetes or AWS CodeDeploy |
Benefits and core values of CI/CD
CI/CD achieves stable and efficient continuous output by using high-frequency delivery, frontloading quality control, and rapid iterative feedback. CI/CD also optimizes team collaboration and resource costs.
High-frequency release: The automatic pipeline minimizes manual intervention and allows multiple deployments per day. CI/CD is far more efficient compared with traditional development models.
Frontloading quality control: Automated testing intercepts defects, significantly reduces the online failure rate, and ensures stability when changes are made.
Continuous feedback: Real-time monitoring is used together with canary release to quickly verify features and reduce trial and error costs.
Improved team efficiency: CI/CD allows developers to focus on innovation and standardize processes to improve collaboration efficiency and reduce repetitive workloads.
Reduced costs and improved efficiency: CI/CD optimizes long-term maintenance costs by using automated processes and further reduces costs by using elastic resources.