How can you use CI/CD in software development?
Description
CI (Continuous Integration) and CD (Continuous Delivery/Continuous Deployment) are software development practices aimed at automating and improving the process of software integration, testing, and delivery.
Continuous Integration (CI)
Continuous Integration refers to the practice of frequently integrating code changes into a shared repository, ideally multiple times a day. Every code change/integration is verified by an automated build which:
- Helps detect code errors and integration issues quickly.
- Automates the testing and building process to increase developer productivity.
Continuous Delivery (CD)
Continuous Delivery ensures that code changes are automatically prepared for release to production, but the actual deployment to production is still a manual decision.
- Ensures software is always in a deployable state.
- Minimises manual steps in the release process.
- Ensures quick rollbacks to a previous deployment if issues arise.
Continuous Deployment (CD)
Continuous Deployment goes a step further than Continuous Delivery by automating the deployment of changes directly to production without manual intervention.
- Automates the entire process, from integration to deployment.
- Delivers features and fixes to users faster.
Considerations
CI/CD practices and tools support various aspects of software development and usage, including:
- Automated builds - every change triggers an automatic build process, including compilation and tests.
- Version control integration - CI/CD systems typically integrate with version control systems that trigger CI/CD workflows on each commit, ensuring no major conflicts or issues accumulate.
- Code testing - automated unit, integration, and regression tests are run with every integration to ensure software stability and to ensure the software works across different environments and platforms.
- Code quality - CI can enforce coding standards through the use of static code analysis or linters.
- Deployment pipelines - software is automatically tested and packaged, ready to be deployed to production.
- Automated monitoring - monitoring software in production exists to catch any issues after deployment.
- Rollback mechanisms - ability to quickly roll back to a previous stable version if issues arise.
Solutions
CI/CD tools and platforms for different stages of code development and deployment include:
- Version Control Systems (VCS) are essential for managing code and version control. Some such tools (like GitHub, GitLab, Bitbucket) also provide CI/CD processes and services built around code repositories - e.g. GitHub Actions, GitLab CI/CD and BitBucket Pipelines.
- CI/CD pipelines - automate the entire process from code integration to deployment. Common tools include:
- GitHub Actions - integrated CI/CD directly within GitHub, with easy-to-set-up workflows (called actions).
- GitLab CI/CD: integrated CI/CD directly within GitLab.
- BitBucket Pipelines: integrated CI/CD directly within BitBucket.
- Jenkins: highly customisable and widely used for CI/CD pipelines.
- CircleCI: focuses on simplicity and speed for building and testing.
- Travis CI: a cloud-based CI service often used for open-source projects.
- Azure Pipelines: part of the Azure DevOps suite, supports various languages and platforms.
- Testing tools - automated testing tools like JUnit, Selenium, Cypress, and Postman integrate with CI/CD workflows/pipelines to ensure the code meets quality standards.
- Artifact repositories - tools like Artifactory or Nexus Repository store build artifacts (e.g., Docker images, binaries) for deployment.
- Containerisation and orchestration
- Docker - to help standardise environments for applications by packaging them in containers.
- Kubernetes - for orchestration, enabling deployment, scaling and management of containerised applications.
- Monitoring - tools like Prometheus, Grafana, and New Relic are used for real-time monitoring in production to ensure system health.
- Infrastructure as Code (IaC) - tools like Terraform, Vagrant or Ansible automate infrastructure provisioning and configuration, ensuring consistency across environments.
Related pages
Skip tool tableTools and resources on this page
Tool or resource | Description | Related pages | Registry |
---|---|---|---|
Ansible | Ansible is a suite of open source command line tools (written in Python) that enables Infrastructure as Code (IaC) - including configuring systems, deploying software, and orchestrating workflows, known for its simplicity and ease of use. | ||
Docker | Docker is a tool for creating isolated environments (application isolation) for software development called containers to enable consistent software running across platforms. Docker allows developers to build, share, run and verify applications easily. DockerHub is a repository for sharing and managing container images. | Creating a good README Reproducible software ... | |
Kubernetes | Kubernetes is a container orchestration platform that manages the deployment, scaling, and operation of containerised applications. | ||
Terraform | Terraform is a powerful and one of the most popular Infrastructure as Code (IaC) tools that enables infrastructure management across multiple cloud providers using a simple, declarative language, | ||
Vagrant | Vagrant is a tool that simplifies and provides a single workflow for the creation and management of virtual machines, and provides full VM isolation. | Reproducible software ... |
How to cite this page
Aleksandra Nenadic, "Continuous Integration and Continuous Delivery/Deployment". everse.software. http://everse.software/RSQKit/ci_cd .