Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily – leading to multiple integrations per day. Each integration can then be verified by an automated build and automated tests.
This approach leads to significantly reduced integration problems, and you can detect errors quickly, and locate them more easily. The goal is to reduce the risk of seeing “integration hell” by waiting for the end of a project or a sprint to merge the work of all developers.
Continuous Integration/Continuous Delivery has become a necessary practice now a days.
There are numerous ways to achieve the same. One of the best approaches is DevOps.
DevOps do not have a fixed definition. Stating a definition by Atlassian below-
DevOps is a set of practices that automates the processes between software development and IT teams, in order that they can build, test, and release software faster and more reliably. The concept of DevOps is founded on building a culture of collaboration between teams that historically functioned in relative siloes.
Microsoft is offering DevOps services by the name of Azure DevOps. We are going to setup CI/CD over the same and will also understand to you can connect under GIT Repository with azure. So, let’s begin –
After you have created Azure devops account and project, you will see similar image as below.
In the left side menu you get an option of Pipelines, this is the place where we need to work on for CI/CD setup.
Broadly categorizing the setup into two parts-
- Connecting Desired Repository
- Configuring CI for the same Repository
Connecting Desired Repository
- Create a new build pipeline.
- Connect it to your desired Git Repository. Here we are using Bitbucket.
- Authorize your desired Repository connection.
- Select branch for Continuous Integration.
- Select appropriate build template. Here we are selecting ASP.NET as template.
This shows azure devops is now connected with your desired Repository.
Configuring CI for the same Repository
- Remove Test Assemblies and Publish Symbols Path from job and add npm install, Gulp 03-Publish-All-Projects and Archive Output. Once done it will look something like the below image –
- Use NuGet 4.4.1
- NuGet Restore – This will restore all the required nuget for the solution.
- Build Solution – Configure your build settings.MSBuild Arguments – a. DeployOnBuild
- Npm Install – This will add node module and let you run gulp task as we need to run gulp task to build and publish the solution.
- Gulp – Configure gulp to run all the task in task runner which will build and deploy the files.
- Gulp File Path – Select your gulp file which contains the task from the Repository.
- Gulp Task – Mention the gulp task function which will build and deploy your solution.
I have updated gulp task to include yml files when publishing the files so that we can run unicorn directly as output folder will contain all ymls as well.
- Archive Output – Create an archive location to keep the published solution files.
- Root folder or file to archive – Create a folder to keep all the published files inside specific folder. I have named it as Output.
- Archive file to create – This field contains the path for archive zip file.
$(Build.ArtifactStagingDirectory) – This is a temporary location to keep your created zip file.
BuildOutputQA5Jul-$(Build.BuildId).zip – This part contains file name. I have added “BuildOutputQA5Jul” as prefix and “-$(Build.BuildId)” this will add unique build id to every build for distinguishing all the output file with respect to build.
- Publish Artifact – This method is used to deploy your output file into artifact so that you can use this file to deploy (CD) later.
- We have configured the build step. Now let’s configure “Triggers” for CI.
- Here will be enable continuous integration and select the branch for which you want to monitor the commits.
Let’s run the build now by click on queue –
So, congratulations on configuring the CI pipeline on Azure cloud along with me. For deploying CD configuration On-premises watch out this space.
A continuation blog (part-2) is available here.