Environment
| Environment | Purpose |
|---|---|
| Local | Developer laptop |
| Dev | Shared team testing |
| SIT | System Integration Test |
| UAT | User Acceptance Testing |
| Staging | Production-like |
| Prod | Live traffic |
Checkout feature branch
↓
Developer writes code
↓
Push feature branch
↓
CI #1 (lint, unit test, security scan)
↓
Open Pull Request
↓
CI #2 (re-run tests, ensure merge safe)
↓
Code Review & Approval
↓
Merge to develop/main
↓
CD pipeline triggers
↓
Build Docker Image (if not built earlier)
↓
Push to Registry
↓
Deploy to Dev
↓
Promote to Staging
↓
UAT Testing
↓
Approval
↓
Deploy to Prod (5% Canary)
↓
Monitor
↓
Full rollout (100%)
Work on dev feature branch
git checkout -b feature/payment-timeout-fix
Complete dev, commit and push to Remote (Feature Branch)
git push origin feature/payment-timeout-fix
Auto trigger and run CI Pipeline #1 (Feature Pipeline)
❌ No deployment
❌ No cluster access
❌ No Docker push (optional)
stages:
- build
- test
- docker
- deploy
build:
stage: build
script:
- mvn clean package
test:
stage: test
script:
- mvn test
docker-build:
stage: docker
script:
- docker build -t $IMAGE_TAG .
- docker push $IMAGE_TAG
Pipeline pass, open Pull Request → target: develop or main
CI runs again on PR branch (since code may have changed OR other commits may have merged)
deploy-dev:
stage: deploy
only:
- develop
script:
- kubectl apply -f k8s/deployment-dev.yaml
Code review happens
PR Approved, branch merge to:
develop → deploy to DEVmain → deploy to STAGING or PRODMerge success auto trigger CD Pipeline
deploy-prod:
stage: deploy
only:
- main
when: manual
script:
- kubectl apply -f k8s/deployment-prod.yaml
QA start doing test.
Promote to Staging / UAT
Manual approval
Or triggered by tagging a release
git tag v1.2.3
git push origin v1.2.3