Tech Insights / CI/CD

CI/CD: Automating the path to the production pipeline

CI and CD stand for continuous integration and continuous delivery and deployment. Continuous integration is a set of modern development best practices and automation for how developers create and make changes to code. The code is then delivered quickly and seamlessly as a part of the continuous delivery and deployment process. Together, CI/CD not only speeds up development but also helps to minimize bugs, reduce code failures, and enable frequent high-quality application deployment.


What is CI/CD?

CI/CD involves automating and monitoring the entire application lifecycle—from development and integrations to testing, delivery, and deployment. These practices are often referred to as the ‘CI/CD pipeline’.

What is CI?

Continuous integration (CI) automates developers' steps to make changes and check their code. This automation ensures that teams can build, test, and package their applications in a reliable and repeatable way.

What is CD?

CD is often used interchangeably to describe continuous delivery or continuous deployment. Continuous delivery usually means that changes to an application are automatically tested and uploaded to a repository (like GitHub). Continuous deployment refers to automatically releasing a developer’s changes from a repository to production, where it can be used by customers.

How does CI/CD work?

In traditional development models, developers often work in isolation to create and make code changes. This can lead to development silos, slowing down development.

In modern application development, the goal is to have multiple developers working simultaneously on different features of the same app, speeding up development and deployment. But this method can quickly cause conflicts unless best practices such as CI/CD are created and implemented.

Continuous integration (CI) provides one repository and helps developers merge their code changes back into a shared branch. Changes are validated and tested automatically, typically including unit and integration tests, making it easier to identify and fix bugs quickly.

Once validated, Continuous delivery (CD) automates the release of the validated code to a repository. The final stage of a mature CI/CD pipeline is continuous deployment, which automates releasing an app to production. This automation means that in many cases, code can be released in only minutes from the time a developer makes a change.

All of these connected CI/CD practices are part of a CI/CD pipeline that implements automation and best practices, making the deployment of an application faster, while also more reliable and less risky.




What's the difference between continuous integration vs. continuous delivery?

The CI/CD pipeline can include automation of a large part of the application management lifecycle. The following are some differences between CI and CD:

  • Continuous integration automates the initial process of creating an application and helps team collaboration by providing a shared repository and best practices for versioning and other tasks. It removes the risk of conflicts when there are too many branches of an app in development at once and provides greater visibility to the entire team.
  • Continuous delivery and deployment are related concepts that sometimes get used interchangeably. Both are about automating further stages of the app development lifecycle after the initial code is completed. It involves delivering changes after testing an application and then automating deployment to a production environment.



What is a CI/CD pipeline?

A well-built CI/CD pipeline makes delivering code to production quick, easy, and reliable. There are eight fundamental elements of the CI/CD pipeline that help ensure maximum efficiency:

  • A single-source repository
    The source code repository should contain everything needed for the build. This includes source code, database structure, libraries, properties files, and version control. It should also contain test scripts and scripts to build applications.
  • Frequent check-ins to the main branch
    Integrate code in your trunk, mainline, or main branch. Avoid sub-branches, use small segments of code, and merge them into the branch as frequently as possible. Don't merge more than one change at a time.
  • Automated builds
    Scripts should include everything you need to build from a single command. This includes web server files, database scripts, and application software. The CI processes should automatically package and compile the code into a usable application.
  • Self-testing builds
    CI/CD requires continuous testing. Testing scripts should ensure that a failed test results in a failed build. Use static pre-build testing scripts to check code for integrity, quality, and security compliance.
  • Frequent iterations
    Make small, frequent iterations rather than major changes. By doing this, it's possible to roll changes back easily if there's a problem or conflict.
  • Stable testing environments
    Code should be tested in a cloned version of the production environment.
  • Maximum visibility
    Information in the repository should be visible to all. Version control is critical to managing handoffs so developers know which is the latest version.
  • Predictable deployments anytime
    CI/CD testing and verification processes should be rigorous and reliable, giving the team confidence to deploy updates at any time.



What's the difference between CI/CD vs. DevOps?

DevOps is a set of agile software development practices that combines the integration of software development (Dev) and IT operations (Ops) with automation. Successful DevOps environments include security in all phases of the development lifecycle, a practice called DevSecOps.

CI/CD pipeline is part of the broader DevOps/DevSecOps framework and is often considered a DevOps tactic. An efficient DevOps process utilizes DevOps CI/CD to automate the building, testing, and deployment of code to dramatically speed up the process of delivering new features and new applications.

By utilizing agile methods such as DevOps and CI/CD automation, software teams are able to deliver code changes quickly and securely while maintaining a more reliable and secure operating environment.




Benefits of CI/CD pipeline implementation

Companies and organizations that adopt CI/CD can gain many advantages and even a competitive edge when compared to traditional software development practices.

  • Greater reliability. Fewer bugs and errors make it into production, giving users and customers a better experience, which can lead to greater customer satisfaction.
  • Greater efficiency. Automation speeds up the ability to create and deploy new features and applications and can reduce development costs.
  • Higher quality and security. CI/CD pipelines include frequent, automated testing to ensure quality and security across the app pipeline.
  • Predictability. CI/CD automates approvals and other operational tasks, removing existing deployment bottlenecks and increasing predictability.
  • Increased productivity. Some estimate that developers spend 35% to 50% of time testing, validating, and debugging code. By automating these processes, developers significantly improve their productivity, giving them more time to build.
  • Faster bug fixes. With CI/CD, small pieces of code are deployed often, and real-time feedback is provided to developers, making bug fixes easier and faster.
  • Reduced burnout. CD automates common manual tasks and can measurably reduce deployment pain. Developers experience less frustration and strain when working with CI/CD processes. This can lead to less burnout.
  • Better collaboration. CI/CD provides a shared working environment for developers and more visibility to the entire DevOps team, improving communication and collaboration.



CI/CD vs. traditional development

With traditional software development processes, developers work in large units, making each step complex and very time-consuming. In modern CI/CD processes, developers work with smaller units of code, and each step includes automation, creating efficiencies across the app workflow.



Stage
CI/CD
Traditional Development
Development Software is developed iteratively in small chunks with frequent feedback. Software is developed in large, complex units with less timely feedback.
Testing Tests are written during development and applied throughout the development process to ensure code quality. The software passes to a separate QA team for testing after the development process is completed.
Security Security patches and bug fixes are quickly deployed via automation. Security patches and bug fixes are delivered immediately through manual exception processes or in bulk at irregular intervals.
Delivery New application code is integrated frequently with the existing codebase and tested in real-world scenarios to ensure the software is always ready for production. New code is integrated infrequently with existing software—usually just prior to deployment—and occurs only in predetermined release windows that may be quarterly or even less frequent.


What to keep in mind if you're considering a CI/CD pipeline

Properly done, a CI/CD pipeline automates the vast majority of the app development workflow, freeing developers and operators from repetitive manual tasks, but it requires changes and the adoption of new best practices. The following is a list of what to consider when adopting a new CI/CD pipeline:

  • Breaking down silos. With CI/CD, testing is part of the development process and there is no need for a separate QA team. Instead, organizations can integrate QA engineers into the core development team for continuous testing.
  • Increased testing. The CI/CD pipeline includes unit tests and end-to-end tests to simulate user workflows throughout the application. This takes more time initially, but the upfront investment in testing provides confidence in the built app.
  • New CI/CD tools. Teams must agree to adopt new CI/CD tools to develop, implement, and monitor automated CI/CD pipelines. This means incorporating new testing frameworks, modern source code repositories, artifact repositories, and CI/CD tools.
  • Updated approval processes. CI/CD automation of common operational tasks provides organizations with the opportunity to re-evaluate approvals and other potential bottlenecks.



The selection of CI/CD tools can be a challenge due to the sheer number of tools that are available in the market. Some tools specifically handle continuous integration, some manage continuous development and deployment, while others specialize in continuous testing or related functions. The following is a list of commonly used CI/CD tools:

  • Jenkins is one of the most used CI/CD open source tools. It is written in the Java programming language and used to implement CI/CD workflows and pipelines.
  • Tekton is a CI/CD framework for Kubernetes platforms that provides standard cloud native building blocks to craft a system that meets the exact needs of a pipeline with containers.
  • GitLab is a cloud-based DevOps platform that helps developers monitor, test, and deploy their code for continuous integration, including testing and security.
  • ArgoCD is a declarative GitOps tool that is lightweight, easy to configure, and purpose-built to deploy applications to Kubernetes so it doesn’t have the UI overhead of many tools built to deploy to multiple locations.
  • Concourse CI is an open source CI pipeline tool that uses YAML files for configuring pipelines.
  • Fastlane is an open source tool that provides developers with the ability to deploy applications to both iOS and Android platforms simultaneously.
  • Additionally, other foundational DevOps tools can be part of a CI/CD process. Tools for configuration automation (such as Ansible, Chef, and Puppet), container runtimes (such as Docker, rkt, and cri-o), and container orchestration (Kubernetes) are not strictly CI/CD tools, but they’ll show up in many CI/CD workflows.



Embracing CI/CD with VMware Tanzu

The ability to deploy new applications and make changes in response to user feedback quickly are hallmarks of a successful digital enterprise. Continuous integration and continuous delivery (CI/CD) play an important role in this process. There are an increasingly large number of products that enable CI/CD automation. Organizations should examine complete solutions that facilitate this process while reducing risk.

VMware Tanzu Platform is an end-to-end integrated platform solution that helps companies build and operate a cloud native application platform with a rich set of developer tooling, security capabilities and pre-paved, customizable golden paths. With VMware Tanzu, your platform engineering teams can help accelerate your company's path to production securely and at scale. VMware Tanzu supports CI/CD automation and DevOps practices so software teams are able to deliver high-quality apps more efficiently.





Frequently Asked Questions

What are CI/CD best practices for building modern applications?

CI/CD brings agility and automation to modern application development. CI/CD speeds up the process of integrating and delivering code, helping to reduce the friction between development and operations teams and facilitating DevOps. A CI/CD pipeline is one of the most important software delivery assets for building, testing, and deploying modern applications.

What is the difference between CI/CD and DevOps?

CI/CD and DevOps both work together to achieve the same goal in software development. The main difference between these terms is the implementation of automation. CI/CD is a set of processes based upon continuous feedback and DevOps is a set of development practices that combines the integration of software development and IT operations with automation that has specific practices to be applied.

What is the CI/CD process?

The CI/CD process begins with continuous integration, which is an automation process for developers. Next, continuous delivery is the process of delivering applications created in the CI process to a production-like environment where they are put through additional automated tests to ensure each application functions as expected when pushed to production environments and put in the hands of real users. Finally, an optional, subsequent step is continuous deployment in which code is automatically deployed to production after going through the CI/CD process.

What are the benefits of CI/CD?

There are numerous benefits of CI/CD, including deploying software on-demand based on business requirements, reducing the risk of software not functioning properly in production, making rapid iteration a reality, and recovering more quickly when failures occur.