What is CI/CD?
CI/CD is a practice that automates building, testing, and delivering software so changes reach users quickly and safely.
CI/CD stands for Continuous Integration and Continuous Delivery/Deployment. It is a way of working where every code change is automatically built, tested, and prepared for release.
Continuous Integration (CI)
Developers merge their code into a shared repository often, sometimes many times a day. Each merge triggers an automated build and test run, so problems are caught within minutes instead of weeks.
Continuous Delivery / Deployment (CD)
- Delivery keeps your app always ready to release; a human clicks the final button.
- Deployment goes one step further and pushes every passing change straight to production automatically.
The pipeline idea
All of this happens in a pipeline — an automated sequence of stages that code passes through on its way to users.
Example
# A CI/CD pipeline automates what you used to run by hand:
git push origin main # 1. developer pushes a change
# 2. CI server checks out the code
# 3. build the application
# 4. run the automated tests
# 5. deploy if everything passedWhen to use it
- A team uses CI to automatically run unit tests on every pull request so bugs are caught before they merge.
- A SaaS company uses CD to deploy every green build to staging within minutes, giving QA instant access to new features.
- A mobile team uses CI/CD to build and sign an APK automatically whenever a release branch is tagged.
More examples
CI steps on a push
Shows the automated steps a CI server runs every time a developer pushes code.
# Typical CI sequence triggered by git push
git push origin feature/login
# CI server automatically:
# 1. git clone <repo>
# 2. npm install
# 3. npm test
# 4. reports PASS or FAILCD delivery to staging
Illustrates the Continuous Delivery step that automatically deploys a passing build to staging.
# After CI passes, CD pipeline continues:
# 5. docker build -t myapp:$BUILD_NUM .
# 6. docker push registry/myapp:$BUILD_NUM
# 7. kubectl set image deploy/myapp \
# app=registry/myapp:$BUILD_NUM
echo "Deployed to staging automatically"Full CI/CD pipeline stages
Describes the four canonical CI/CD stages in readable YAML pseudocode.
# Conceptual CI/CD pipeline stages
pipeline:
stages:
- name: build
run: mvn package -DskipTests
- name: test
run: mvn test
- name: publish
run: docker build && docker push
- name: deploy
run: helm upgrade myapp ./chart
Discussion