CI/CD Interview Question
What is continuous integration?
It is a development practice that requires developers to integrate code into a shared repository several times a day. Each check-in is then verified by an automated build, allowing teams to detect problems early.
In the diagram shown above:
- Developers check out code into their private workspaces.
- When they are done with it they commit the changes to the shared repository (Version Control Repository).
- The CI server monitors the repository and checks out changes when they occur.
- The CI server then pulls these changes and builds the system and also runs unit and integration tests.
- The CI server will now inform the team of the successful build.
- If the build or tests fails, the CI server will alert the team.
- The team will try to fix the issue at the earliest opportunity.
- This process keeps on repeating.
Why is Continuous Integration important?
Two important reasons:
- Defects found early cost less to fix : When a defect is found immediately after a developer codes it, it takes 10x times less time to fix it compared to finding the defect a month later.
- Reduced Time to Market : Software is always tested. So, it is always ready to move to further environments.
What are the success factors for Continuous Integration?
Here you have to mention the requirements for Continuous Integration. You could include the following points in your answer:
- Maintain a code repository
- Automate the build
- Make the build self-testing
- Everyone commits to the baseline every day
- Every commit (to baseline) should be built
- Keep the build fast
- Test in a clone of the production environment
- Make it easy to get the latest deliverables
- Everyone can see the results of the latest build
- Automate deployment