One of the goals of DevOps is to provide faster and stable releases. In this regard, the terms Continuous Integration (CI) and Continuous Deployment (CD) are critical for a successful Azure Deployment. CI is a software development practice that requires developers working on the project to integrate code into a shared repository, whereas CD is more like an extension of CI that enables you to ship software faster continuously over a period.
What is Azure DevOps?
A compound of development and operations is Azure DevOps. It is the union of people, processes, and technology to provide higher value to customers. It enables the organization’s formerly siloed roles—development, IT operations, engineering to coordinate and collaborate to make improved products and accelerate time-to-market.
Why CI/CD is an Imperative?
CI/CD enables organizations to deliver value faster to your customers and pushes each of your changes autonomously to the Web Apps. CI process repeated every time a team member commits any code changes to version control. This is a best practice by which developers can share their code and unit tests by merging their changes after every task is accomplished. Whenever any developer commits any code, it triggers an automated build to grab the latest code from the shared repository, and it will build, test, and validate the master branch.
Tools for Continuous Integration with Azure DevOps
Attaining the quality of speed is the new normal when it comes to software development. With many CI/CD tools available, teams struggle to make the right choice. Here are some tools with their key features that could help you to get the job done quickly and efficiently.
- Jenkins — a free, open-source, Java-based tool that gives you a lot of flexibility
- Azure Pipelines — a Microsoft product free for up to five users and open-source projects
- Cloud Build — the managed service offering from Google Cloud Platform
- Travis CI — a popular tool for GitHub open-source projects that offers a hosted or self-hosted solution
- GitLab CI — a free tool from GitLab that can also integrate with other tools via the API
- CircleCI — a tool that is popular for GitHub projects and has a hosted and self-hosted solution, you can start for free.
- CodeShip — a self-hosted-only solution. You can start with the free version, but it’s a paid tool.
Through this blog we will see how CI/CD can be configured in Azure DevOps and we will be using the Azure Pipelines. It is mainly used to continuously build, test, and deploy to any platform and cloud. A cloud-hosted pipeline for Windows, Linux, and macOS can be created with unlimited minutes.
Process to setup Continuous Integration with Azure DevOps
1. Open project Menu in visualstudio.com
2. Click the pipelines option and click the new pipeline.
3. Select the source, Team project, Repository, default branch for manual and scheduled builds. Click on “Continue”.
4. Select the templates for the source. Current project is ASP.NET Core, so select the template accordingly.
5. Click on Apply after template selection.
6. In tasks, name the Pipeline and select the agent pool as appropriate.
7. Under the agent job, we can find the jobs that agent will perform, like build, test and publish.
8. Configure each job – Restore, Build and Test as needed.
9. We can skip Publish Job, as we do not need to publish the build.
10. In Triggers section, click on “Enable Continuous Integration” and “Batch changes while build is in progress”.
11. Click on scheduled and schedule the days as needed and must select the check box “Only schedule build if the source or pipeline has changed” in right side panel.
12. Click on “Save & Queue”, to complete setup.
Note: First build will be run as soon as we save the queue. All members of the project will be notified about the Build status through Email.
13. All the builds will be listed in Builds section under Pipeline with the build result.
14. Below is the screenshot of sample Email Notification.
CI continues to be a best practice for software development. It improves the quality of the deliverables by continuous build and test process. CI can enable team to resolve any issues and rebuild and retest. This saves time for the development team because they need not spend days or weeks integrating the code and merging the conflicts on Azure DevOps. The CI/CD tools mentioned above highlights their key features, the usage of them will depend on your project requirement, existing infrastructure and other factors that will impact your final decision with respect to tool.