In this time of software development, where in we develop and deploy new feature every sprint, automated deployment (CI/CD) play a pivotal role. Combnation of Git and DevOps configuration (Branching) helps to maximize effectivess of delivery. Here we will look at Git-DevOps integration which would allow effective delivery of projects and new features.
Read my introductory post on Git Terminologies Overview to understand basics of git and for DevOps.
Why Git – DevOps Integration?
As mentioned above Git and DevOps tools play vital role in your delivery
The Development team use Git to manage their source for various features. Git is the latest of source control mechanism. Although there are many other source controls , Git is popularly used due to its distributed source control mechanism which gives below benefits
- Git is not based on client -server model entirely.
- Developers can create branches as per their need which increases the development speed
- Allows you to track every code changes to a file
- Git is fast and simple to learn
- Allows developers to work offline and still create branches locally to develop multiple features.
While DevOps provides below benefits w.r.t delivery
- Continuous Integration
- We need to implement basic CI process to ensure new code commits are not breaking and follows basic coding standards
- Automated Delivery
- We need to deploy to multiple environments and Automated Delivery will ensure it is consistent , stable and faster than manual.
- Automated QA
- DevOps allows us to perform basic validation and QA automatically there by validate if latest deployment is success or has resulted in breaking changes, accordingly DevOps can revert back to previous successful build.
While Git and DevOps individually provide benefits, integrating both will enhance your ability to deliver efficiently and code follows through a process of validation before getting into production.
In a Nutshell, DevOps with use the CI process to validate every commit for its quality and non breaking changes. Continuous Integration process creates an ‘Artifact’ which can be deployed into servers using Continuous Deployment process.
One of the key benefits of CI/CD is to ensure every code changes are tested continuously to avoid faulty code / feature getting into production. One other purpose of CI/CD is to ensure untested code never gets into production , even by mistake.
The picture above provides one of the approach for Git and DevOps integration . We have applied specific Branching strategy on our git repository, each branch is configured to have a specific path to the stages.
For ex :
all Release branches (Release 1, Release 2 etc.) are deployed to ‘Development ‘ stage only.
When the code gets merged to develop branch , the build from develop can now not only move to ‘Development’ , the same build can be promoted to ‘QA’
and with Git, only way to move code is via a ‘Pull Request’ , thereby ensuring the code is reviewed before comiting the code to parent branch.
Now in DevOps, the deployment can be controlled based on some kind of a filter, where in the DevOps tool will decide whether to deploy the build to corresponding environment. In the image above, Deployment to Production is only possible after code is merged to ‘master’ using a pull request. What is depicted above is a standard Git-DevOps integration , although it is always customised based on project needs and process. Setup a free session to review your Git-DevOps integration for effective delivery.