The continuous integration and continuous delivery (CI/CD) method are transforming DevOps. Even if each step of the software development lifecycle can be carried out manually, CI/CD automates the stages in software development and deployment.
Continuous integration is the process of merging code (updates or existing features) with an existing codebase (software tool or product, for example). CI is a development practice where developers merge code in a central repository several times daily.
In CI, each line of code added to the codebase triggers a sequence in a CI/CD pipeline, generating feedback to developers. This process allows improvements to be made quickly and easily.
CD is the attempt to speed up and automate deployments. An operator can push out multiple deployments in a week across numerous services and know the exact condition of the applications and infrastructure in the course of the deployments.
“Continuous delivery is the natural extension of continuous integration, an approach in which teams ensure that every change to the system is releasable, and release any version with the push of a button. Continuous delivery aims to make releases boring so that we can deliver frequently and get quick feedback on what users care about.” — Thought Works
To run a CI/CD pipeline successfully, organizations should outline goals that guide developers’ approaches and processes. While each pipeline is unique, it should reflect some overarching goals.
Here are some results that should be the focus of the pipeline:
CI/CD automation allows code changes to reflect in end users’ software automatically. CI/CD pipelines should prioritize quick fixes and improvements to existing code to improve software quality and user experience.
Continuous delivery requires a “state” machine, which is not provided by CI tools. CD tools, such as Spinnaker, have the ability to take an environment from one state to the next until it makes it all the way to production. The machine will move the environment, such as Docker containers, through to production in an automated fashion. It will even have the ability to do things such as rollbacks, canary deployments, and scaling instances. This process allows for the agile, push-button, automated deployments that an ideal CD mindset drives towards. Such pipelines are at the core of CD capabilities because they orchestrate a repeatable deployment over stages.
One of the higher-level achievements in a DevOps transformation is continuous delivery. Focusing on software releases in a CI/CD pipeline is a cultural shift for companies because it involves organizational change, too. DevOps transformation means building cross-functional teams with common goals, aligning the organization around the architecture and creating a culture of continuous improvement.
The process for achieving CI/CD goals has been broken down into six stages. The goal is to ensure that new and runnable code is fit for use before it’s sent out to end-users.
Most unique and effective pipelines mirror the following structure:
An increasing focus on continuous delivery (CD) has brought new tools and practices that allow teams to produce frequent, fast, and, above all, boring automated releases. Cloud native CI/CD requires a deeper understanding of DevOps practices and how they affect the way organizations deploy and manage workloads using containers, microservices, and serverless functions.
A new approach to continuous integration and continuous delivery (CI/CD) is emerging for cloud native architectures. With cloud native architectures, complexity is shifting away from building and assembly of code towards orchestration of releases. Build tools such as Travis CI and Jenkins are starting to commoditize and become much simpler. As more and more organizations get comfortable with building custom code using containers and other immutable constructs, they spend fewer cycles on building that code and shift into solving the problems of orchestrated releases.
Kubernetes, the open source container orchestrator, makes CD easier to execute with tools, modularity, and immutable infrastructure. Kubernetes simplifies deployment and monitoring of microservices. It helps define a container deployment and manage instances but leaves it up to the user to automate those deployments into environments.
Here are some proven practices for improving Kubernetes CI/CD:
As much as the CI/CD process is evolving, it is not without challenges. Some difficulties faced include:
CI/CD practices are constantly getting refined. Learn more about CI/CD trends, new approaches, and opinions of industry experts through The New Stack articles in this category.