CI - CD using Docker & Azure DevOps integrated with MS Teams

Tested Infrastructure

Platform URL Reading Time
Azure DevOps https://dev.azure.com/sujithar37/RWODevOpsTest 3 min

Introduction

This guide will explain a few core concept about CI-CD pipeline using Azure DevOps for Docker based deployments. Also, this could be more likely a generic CI-CD template which can even customize in depth by going through the relevant documentations and it has been described very well in the configuration files(azure-pipelines.yml && Dockerfile) and how we can play with those etc.

This guide has 3 sections as follows,

Let’s get started,

Pre-requisite

Problem Statement

CI [Continuous Integration]

  1. Since it has been written in C++, use below the command to generate the build file named as ‘binary.out’
    g++ -std=c++11 -I/usr/include/boost/asio -I/usr/include/boost -o binary.out main.cpp connection.cpp connection_manager.cpp mime_types.cpp reply.cpp request_handler.cpp request_parser.cpp server.cpp -lboost_system -lboost_thread -lpthread 
    
  2. For every commits or manual queue, the CI needs to be triggered and the respective build information should be updated in the ‘readme.txt’ file with the below format,
      build_number = $a.$b.$c where $a is a build pipeline variable that can be set , $b is some incremental value, and $c is git commit SHA
    

CD [Continuous Deployment]

  1. Bring up a Docker image with the generated builds and finally push that into Docker Hub.

Solution

  1. Import the Github project into Azure DevOps repository since it can provide an all-in-one solution which starts from Azure Boards to Artifacts.
  2. Checkout the azure-pipelines.yml which contains the detailed instructions how the CI has been built.
  3. Checkout the Dockerfile which contains the detailed instructions how the docker image has been built as soon as CI is done.
  4. Enable the CD process through a Release pipeline which uses the RWO_Artifacts CI-Artifacts and the below task picker docker-build&push from market place Release_Pipeline-Tasks

  5. Finally the generated docker image will be available at DockerHub-sujithar37/rwobinary as part CI-CD process DockerHub-sujithar37

  6. The above deployment can be done either via automated or approval through MS Teams channel.MS Teams Integration

Maintained by:

Sujith Abdul Rahim