Continuous integration (CI) and continuous delivery (CD) are essential parts of DevOps. Mastering them can help you in your next DevOps interview. Below are the top 10 must-know questions for CI/CD.
1. What is CI/CD in DevOps?
2. Explain the role of version control systems in CI/CD.
3. What is the difference between continuous deployment and continuous delivery?
4. How do you handle failed builds in CI?
5. How would you implement a CI/CD pipeline from scratch?
6. What tools have you used for CI/CD?
7. What is the role of Docker in CI/CD?
8. How do you ensure security in CI/CD pipelines?
9. Explain rollback strategies in CD.
10. What is blue-green deployment in CD?
These questions cover the essentials of CI/CD. Here is a simple Python script for a CI pipeline:
import subprocess
def run_tests():
result = subprocess.run(["pytest", "tests/"], capture_output=True)
if result.returncode != 0:
print("Tests failed!")
return False
print("All tests passed!")
return True
if __name__ == "__main__":
if run_tests():
print("Ready for deployment!")
else:
print("Fix the issues and try again.")
Leave a Reply