Blog‎ > ‎6. DevOps‎ > ‎

9.Continuous Integration

Importance of Continuous Integrations in DevOps

Continuous Integrations

In Continuous integrations, all the developer work is merged to main branch several times a day. This helps in reducing integration problems.

In Continuous integration we try to minimize the duration for which a branch remains checked out. A developer code gets early feedback on the new code added to main repository by using Continuous Integration.

Best Practices of Continuous Integrations

Some of the Best Practices of Continuous Integrations are

·         Build Automation : In CI, we create such a build environment that even with one command build can be triggered. This automation is done all the way upto the deployment to Production environment.

·         Main Code Repository: In CI, we maintain a main branch in code repository that stores all the Production ready code. This is the branch that we can deploy to Production any time.

·         Self-testing Build : Every build in CI should be self-tested. It means with every build, there is a set of tests that runs to ensure that changes are of high quality.

·         Everyday commit to baseline : Developers will commit all of their changes to baseline everyday. This ensures that there is no big pileup of code waiting for integration with the main repository for a long time.

·         Build every commit to baseline : With automated continuous integration , every time a commit is made into baseline, a build is triggered. This helps in confirming that every change integrates correctly.

·         Fast Build Process : One of the requirements of CI is to keep the build process fast so that we can quickly identify any problem.

·         Production like environment testing :  In CI, we maintain a production like environment also known as pre-production on staging environment, which is very close to the Production environment. .We perform testing in this environment to check for any integration issues.

·         Publish Build Results : We publish build results on a common site so that everyone can see these and take corrective actions.

·         Deployment Automation : The deployment process is automated to the extent that in a build process we can add the steps of deploying the code to a test environment. On this test environment all the stakeholders can access and test the latest delivery.

Benefits of Continuous Integrations

·         CI makes the current build constantly available for testing, demo and release purpose.

·         With CI, developers write modular code that works well with frequent code check-ins

·         In case of a unit test failure or bug, the developer can easily revert back to the bug-free state of the code.

·         There is drastic reduction in the chaos on release day with CI practices

·         With CI, we can detect Integration issues much earlier in the process

·         Automated testing is one very useful side effect of implementing CI

·         All the stakeholders including the business partners can see the small changes deployed into pre-production environment. This provides early feedback on the changes to software.

·         Automated CI and testing generates metrics which helps in improving the development options.