What is CI/CD and how to apply it in your organization?

Qu’est-ce que le CI/CD et comment l’appliquer dans son organisation ?
What is CI/CD and how to apply it in your organization?

By Gologic with the collaboration of Alexandre Couëdelo.

Continuous Integration (CI) and Continuous Deployment (CD) are the core practices you will need to master to achieve a successful DevOps transformation.

Continuous Deployment is the Holy Graal of DevOps. It means your entire process is so mature that any code change is fully validated and sent to production automatically. While Continuous Integration is the foundation on which everything relies, allowing developers to frequently make changes to an application and be sure those changes integrate well with the work of others.

To bridge the gap between CI and CD, you will need to equip yourself with several other DevOps practices such as Continuous Testing (CT), Continuous Delivery, Observability, and Monitoring.

However, change management is complex. Simply building a CI/CD pipeline by the book is not sufficient to succeed. For your organization to be ready, you need to pave the ground for a real “Dev” and “Ops” collaboration.

On one hand, “Ops” will need to define the proper infrastructure in which the DevOps culture can grow, and on the other hand, “Dev” needs to put in place the fail-fast approach. Finally, you will refine the process by using the Shift Left principle.

In this article, you will learn what needs to be done to prepare your organization.

Defining the next Infrastructure

On the Operation side, moving the organization towards CI/CD implies redefining the infrastructure. Indeed you need a more collaborative way to operate the production environment.

The success of DevOps comes along with the self-services model. You must have heard of IaaS (Infrastructure as a Service), PaaS (Platform as a Service), SaaS (Software as a Service). These external providers will help your teams build your infrastructure more easily using API and configuration management tools.

You also need to build an internal Self-Services on which the teams can rely to build a new application with sufficient autonomy. Often Operation teams will automate and create recipes to fasten software development and delivery while keeping cost and security under the radar.

Your new infrastructure should look along these lines:

1. Micro-services: manages by developers “You build it; you run it.”

2. Resources: infrastructure components require by micro-services (ex.: database) are managed by developers based on templates provided by Ops.

3. Shared Services: tools used by both Dev and Ops to manage software life cycle (code repository, CI/CD toolchain, monitoring).

4. Platform: a layer of abstraction to facilitate integration and software operation (ex.: Kubernetes).

5. Infrastructure: the bottom of the iceberg with machines and network.

DevOps_Infrastructure

Before you start, identify what is missing to adopt the self-service model.  Evaluate your existing tools and see how to make them better fit in the new model. Challenge your current providers or find new ones that better fit with the targeted model.

Building the feedback loop

On the software engineering side (“Dev”), everything starts with adopting the fail-fast approach.

The fail-fast approach requires you to implement validation at every step of the process. If a validation step fails, the teams need to rework the code until it passes the required criteria. It may be a frustrating transition for those not familiar with the fail-fast approach. Therefore you need to use an iterative process. Automate a small part of the process until it becomes robust and stable. Only then move on to another part of the process.

DevOps_Deployment_Pipeline

You always start the journey by implementing Continuous Integration. Once the teams commit changes to the version control system, the code is compiled, and unit tests are executed. If the code doesn’t meet a quality threshold (code coverage, bug detection, security audit), the teams are alerted, and the code needs to be fixed to move further in the process.

The second step is to put in place the foundation for Continuous Testing (CT). Only automate critical and repetitive tests with high added value. At this point, it is more important that you simplify the process than implementing tests.

Next, improve your monitoring and alerting capabilities. The best way to start is to get notified every time an error occurs during office hours and take time to analyze them. There may be a lot of alerts initially, but in no time, the team will learn to better manage errors in their code, and alerts will become more meaningful.

Finally, keep improving until you are confident enough to deploy into production automatically (Continuous Deployment). To achieve this goal, try to remove the bottlenecks as early as possible. A common strategy is to apply the Shift-Left principle. Automate all those things you used to do at the end and do it as early as possible to reinforce the fail-fast approach.

Wrap up

Continuous Integration (CI) and Continuous Deployment (CD) are a must-have for an organization to achieve fast and reliable software delivery.

To succeed there is two things you need to address:

  • Bring “Devs” and “Ops” closer by revisiting your architecture and adopting the Self-Service Model.
  • Put in place the fail-fast approach and slowly add capabilities to the process until you achieve Continuous Deployment.

Get expert DevOps advice

Do you want to create your automated software deployment chain and speed up your deliveries? Gologic DevOps advisors can help you set up pipelines as code, including continuous development, integration, testing, delivery and deployment (CI/CD). Explore our services or contact us to learn more about our strategic approach.

By Gologic with the collaboration of Alexandre Couëdelo.

Suivez-nous et partagez

Leave a Reply