Continuous delivery is a software development process that has gained popularity over the last ten years. It improves the development process, reduces risks, and lowers costs.
Here’s what continuous delivery is about, how it works, and how it differs from continuous integration and continuous deployment.
What is Continuous Delivery?
Continuous delivery (CD) is producing and releasing software in short cycles. This is achieved by releasing all code changes to a testing or production environment after the build stage.
CD is often considered the second part of the continuous integration / continuous delivery (CI / CD) method. Whereas with CI, new code is merged into a shared repository (main branch), with CD, new code is automatically released to a source code repository from where it can move on to production and be deployed.
CD allows developers to automate the testing process beyond build and unit testing and run integration, load, UI, and other tests before the final push to deployment. It enables them to validate updates more rigorously and consistently and spot problems early on.
CD offers improvements compared to an entirely manual approach thanks to the standardization and automation of the test process. These include significant improvements in the speed of development, testing, and software deployment. They also increase the frequency of release, reduce costs and time, and lower risks due to the more incremental nature of the updates. Once CD is successfully set up, it allows for a repeatable and dependable deployment process.
The Benefits of Continuous Delivery
A CD approach offers several distinct and important benefits compared to a more traditional one. These include:
- Lower risk associated with releases
- Lower costs due to incremental development
- Short time to market
- Higher quality products
- Feedback-driven process
- Improved working environment
Agile, Continuous Delivery
While CD is not explicitly mentioned as part of the Agile manifesto, its principle is present. CD is aimed explicitly at iterative, incremental, and evolutionary development. It also favors short feedback loops and adaptation cycles and emphasizes quality. This overlaps with the Agile methodology and mindset, and the two are entirely compatible.
Unlike a typical Agile lifecycle, an Agile, continuous delivery lifecycle is explicitly intended to result in a new functionality at the end of an iteration cycle instead of a set of iterations.
Adopting an Agile CD approach makes sense within organizations with already established and mature CI/CD and DevOps practices. The development team is stable and has worked on several releases already. It also makes sense for projects where providing stakeholders value before a complete product is essential.
Continuous Delivery Pipeline
CD pipelines vary from organization to organization through several standard stages that are often included in the process. The main guiding principles remain that the pipeline must operate on providing quality products predictably and frequently that go from test to staging automatically.
The four most common stages included in the continuous delivery pipeline include:
- Component stage
- Subsystem stage
- System stage
- Production stage
In short, components are built and reviewed at the component stage and then undergo unit tests and static code analysis. In the next stage, subsystems are made up of components and undergo a separate set of testing phases, such as functional tests; they are certified in the test environment and are also assessed regarding performance and security benchmarks.
Next, if needed, subsystems are assembled into a system and are certified again through integration, performance, and security tests. This may create issues if the system must be certified rather than if subsystems can be deployed independently, but sometimes this is necessary.
Finally, at the production stage, versioned artifacts are deployed. A blue-green deployment is a common approach at this stage to guarantee that if issues arise, they will only affect a low percentage of users (green). If no problems are found, updates are deployed for everyone.
An essential element of continuous delivery is the usage of so-called “manual gates.” Typically, with CD, the process up to production is fully automated, but a manual gate is placed before this step, requiring manual input to deploy code into production. The manual gate serves as a final safety valve. Sometimes more than one manual gate may be present, but with continuous delivery, at least one manual gate is usually present.
Continuous Integration vs. Continuous Delivery vs. Continuous Deployment
Continuous integration, delivery, and deployment are three phases on a continuum that is the process of continuously developing software to improve both the process and results.
With continuous integration, companies only automate the merging of changes to the main branch as often as possible. In some cases, this also includes verifying each update through an automated build and even testing the build though tests are usually part of continuous delivery.
Continuous delivery takes this a step further by automating the deployment of code changes to testing and/or production environments. This reduces yet another manual gate, speeding the process further without creating major risks. This prepares the software to be deployed up until the final decision.
Finally, with a continuous deployment pipeline, the last manual hurdle is removed, making the whole process from integration and delivery up to deployment fully automated. Unless a test fails during the process, users roll out changes immediately.
These are the main differences between these elements of the continuous development framework.
Is continuous delivery the same as continuous deployment?
No, continuous delivery is different from continuous deployment though they are part of the same continuum of continuous software development. Continuous delivery automates the development process, including merging code into the main branch, its release into a source code repository, necessary build and unit tests, and staging. The production or deployment phase is performed manually. With continuous deployment automation, all manual processes are removed.
What is meant by the continuous integration / continuous delivery pipeline?
The CI/CD pipeline is the process of monitoring and automating the steps from integration to delivery to improve the software development workflow. This includes the building, testing, merging, and releasing of a new version of an application.
What are the benefits of continuous delivery?
Some of the benefits of the CD process include: faster update delivery, improved developer productivity, higher quality products, faster spotting and fixing of bugs, an automated release process, reduced development costs, and more.