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,
- Pre-requisite - Things to learn/notice before you jump in
- Problem Statement - Of course, what is the problem?
- Solution - Okay, Here is the solution of your problem!!!
Let’s get started,
Pre-requisite
- A General View about Azure DevOps and MS Teams
- Integration - Azure Pipelines with MS Teams
- Create an account with DockerHub
Problem Statement
- Enable CI-CD pipeline in one of the Github project using below standards,
CI [Continuous Integration]
- 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
- 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]
- Bring up a Docker image with the generated builds and finally push that into Docker Hub.
Solution
- Import the Github project into Azure DevOps repository since it can provide an all-in-one solution which starts from Azure Boards to Artifacts.
- Checkout the azure-pipelines.yml which contains the detailed instructions how the CI has been built.
- Checkout the Dockerfile which contains the detailed instructions how the docker image has been built as soon as CI is done.
-
Enable the CD process through a Release pipeline which uses the RWO_Artifacts and the below task picker docker-build&push from market place
-
Finally the generated docker image will be available at DockerHub-sujithar37/rwobinary as part CI-CD process
- The above deployment can be done either via automated or approval through MS Teams channel.
Maintained by:
Sujith Abdul Rahim