CI/CD, modern yazılım gelişiminin sırtı. Her commit otomatik test → kalite kontrol → staging deploy → production. Manuel deploy yapan ekipler 2026'da hâlâ varsa rekabet edemiyor.
CI vs CD
- CI (Continuous Integration)
- Her commit'te otomatik build + test.
- CD (Continuous Delivery)
- Test geçen kod staging'e otomatik deploy.
- CD (Continuous Deployment)
- Production'a otomatik deploy (insan onayı yok).
Popüler platformlar
- GitHub Actions — GitHub repo'larında native, 2000dk/ay ücretsiz
- GitLab CI — GitLab dahili, runner self-host kolay
- CircleCI — eski popüler, performans odaklı
- Jenkins — open source veteran, self-host
- Bitbucket Pipelines — Atlassian
- Vercel/Netlify built-in CI — frontend için yeterli
GitHub Actions örneği
`.github/workflows/ci.yml` dosyası ile yaml-tabanlı yapılandırma. Trigger (push, PR) → job'lar → step'ler. Marketplace'te 10K+ pre-built action.
Tipik workflow
- 01Trigger: push to main or PR
- 02Checkout — repo'yu clone et
- 03Setup — Node.js, Python, vs. install
- 04Cache — node_modules, build cache restore
- 05Install — dependencies
- 06Lint — ESLint, Prettier
- 07Type check — TypeScript tsc
- 08Test — unit + integration
- 09Build — production artifact
- 10Deploy — staging veya production
Test pyramid
- Unit tests (en çok, en hızlı) — function level
- Integration tests — API + DB
- E2E tests (en az, en yavaş) — gerçek tarayıcı (Playwright, Cypress)
Deployment stratejileri
- Blue/Green
- İki paralel env, switch yap. Zero downtime.
- Canary
- Yeni versiyonu %5 trafiğe aç. Kademeli.
- Rolling
- Pod by pod güncelle. K8s default.
- Feature flag
- Kod prod'da ama özellik kapalı. LaunchDarkly, GrowthBook.
Secret yönetimi
- GitHub Secrets — repo veya organization seviyesi
- HashiCorp Vault — enterprise secret store
- AWS Secrets Manager / Parameter Store
- Doppler — cross-platform secret sync
- Asla .env'i commit'leme — .gitignore'a ekle
Cache strateji
- Dependency cache (node_modules, .pnpm-store) — build 5-10x hızlı
- Docker layer cache — multi-stage build
- Next.js build cache — incremental builds
- Test result cache — Turborepo, Nx
Monorepo CI
Turborepo, Nx, Lerna ile büyük monorepo'larda sadece değişen paket'ler test edilir. 50 paketten 3'ü değişti → 3 paket test, diğerleri skip. CI süresi %80 azalır.
Şunu yapmayın: tüm CI/CD'yi tek workflow'da yapmak
1000 satırlık yaml dosyası bakımı kabus. Reusable workflow'lar (GitHub Actions) veya composite action ile modülerleştir.
NotCI/CD kurulum + best practice: +90 537 729 40 97 (WhatsApp). 1 haftada full pipeline canlıya.