9. What are the best practices of Continuous Integration (CI)?
Some of the best practices of Continuous Integration (CI) are as follows:
I. 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 up to deployment to Production environment.
II. 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.
III. 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.
IV. Every day commits to baseline : Developers will commit all of theirs 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.
V. 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.
VI. Fast Build Process : One of the requirements of CI is to keep the build process fast so that we can quickly
identify any problem.
VII. Production like environment testing : In CI, we maintain a production like environment also known as preproduction
or staging environment, which is very close to Production environment. We perform testing in this
environment to check for any integration issues.
VIII. Publish Build Results : We publish build results on a common site so that everyone can see these and take
corrective actions.
IX. Deployment Automation : The deployment process is automated to the extent that in a build process we can
add the step of deploying the code to a test environment. On this test environment all the stakeholders can
access and test the latest delivery.