Git & GitHub
/Advanced
CI/CD Basics
Definition
Continuous Integration (CI) is the practice of automating the integration of code changes. Continuous Delivery (CD) is the practice of automating the deployment of those changes to production.
Explain Like I'm New
The holy grail of modern software development. - CI: You push code, a robot tests it. If it fails, it blocks the PR. (Quality Control). - CD: You merge the PR, a robot instantly takes the code and puts it on the live internet. (Automated Shipping).
Real World Example
At Netflix or Amazon, developers don't manually log into servers to update the website. They merge a PR, and the CD pipeline automatically rolls the update out to 5% of users, tests for crashes, and then rolls it out to 100%.
Common Use Cases
- •Rapid feature release
- •Preventing bugs in production
Architecture & Flow
Terminal Output
bash / terminal
// A typical CI/CD Pipeline Flow
/*
1. Developer pushes branch to GitHub.
2. [CI RUNS]: Linter checks for messy code.
3. [CI RUNS]: Unit Tests run.
4. [CI RUNS]: Integration Tests run.
5. Reviewer approves PR.
6. PR Merged to Main.
7. [CD RUNS]: Docker image built.
8. [CD RUNS]: Docker image pushed to AWS.
9. Users see the new feature!
*/
Interview Questions
basic
- What does CI stand for?
intermediate
- What is the main difference between Continuous Delivery and Continuous Deployment?