# Mobile DevOps Best Practices: CI/CD, Automation ve Release
Modern mobil uygulama gelistirme sadece kod yazmaktan ibaret degil. Build otomasyonu, surekli entegrasyon, otomatik test, code signing yonetimi, beta dagitim ve release surecleri - tum bunlari verimli yonetmek icin saglam bir DevOps stratejisi gerekir. Bu rehberde iOS odakli mobile DevOps pratiklerini bastan sona ele alacagiz.
Not: Bu rehber GitHub Actions, Xcode Cloud ve Fastlane odaklidir. Ancak prensipler Bitrise, CircleCI, Jenkins gibi diger platformlara da uygulanabilir.
Icindekiler
- Mobile DevOps Nedir?
- CI/CD Pipeline Tasarimi
- GitHub Actions ile iOS CI
- Xcode Cloud
- Fastlane Otomasyonu
- Code Signing Yonetimi
- Otomatik Test Stratejisi
- Beta Dagitim
- Release Yonetimi
- Monitoring ve Rollback
- Sonuc ve Oneriler
1. Mobile DevOps Nedir?
Mobile DevOps, geleneksel DevOps prensiplerinin mobil uygulama gelistirme surecine uyarlanmasidir. Ancak mobil dunyanin kendine ozgu zorlulklari vardir:
Web vs Mobile DevOps Karsilastirmasi
Ozellik | Web DevOps | Mobile DevOps |
|---|---|---|
**Deploy** | Aninda (server) | App Store review (1-7 gun) |
**Rollback** | Aninda | Yeni surum gerekir |
**Build** | Dakikalar | 10-45 dakika |
**Signing** | SSL cert | Code signing + provisioning |
**Dagitim** | CDN | App Store / TestFlight |
**Test cihazi** | Browser | Fiziksel cihaz + simulator |
**Surum** | Continuous | Discrete (1.0, 1.1...) |
**Hotfix** | Aninda | Expedited review (24-48 saat) |
DevOps Maturity Seviyeleri
Seviye | Aciklama | Tipik Goruntuler |
|---|---|---|
**Level 0** | Manuel | Her sey elle, "works on my machine" |
**Level 1** | Basic CI | Otomatik build, basit testler |
**Level 2** | CI/CD | Otomatik test + TestFlight dagitim |
**Level 3** | Advanced | Code signing otomasyon, feature flags |
**Level 4** | Elite | Trunk-based, release trains, auto-rollback |
2. CI/CD Pipeline Tasarimi
Ideal bir iOS CI/CD pipeline su adimlardan olusur:
swift
1PR Acildi2 --> Lint(SwiftLint) [1 dk]3 --> Build(Debug) [5 dk]4 --> Unit Tests [3 dk]5 --> UI Tests [10 dk]6 --> Code Coverage [1 dk]7 --> PR Status Check8 9Main Branch Merge10 --> Build(Release) [8 dk]11 --> Full Test Suite [15 dk]12 --> Archive [5 dk]13 --> TestFlight Upload [3 dk]14 --> Slack Bildirim15 16Release Tag17 --> Clean Build [10 dk]18 --> Regression Tests [20 dk]19 --> Archive + Sign [5 dk]20 --> App Store Upload [3 dk]21 --> Release Notes3. GitHub Actions ile iOS CI
yaml
1# .github/workflows/ios-ci.yml2name: iOS CI3 4on:5 pull_request:6 branches: [main, develop]7 push:8 branches: [main]9 10concurrency:11 group: ios-ci-PR_NUMBER12 cancel-in-progress: true13 14jobs:15 lint:16 runs-on: macos-1417 steps:18 - uses: actions/checkout@v419 - name: SwiftLint20 run: |21 brew install swiftlint22 swiftlint lint --strict23 24 build-and-test:25 needs: lint26 runs-on: macos-1427 steps:28 - uses: actions/checkout@v429 30 - name: Select Xcode31 run: sudo xcode-select -s /Applications/Xcode_15.4.app32 33 - name: Cache SPM34 uses: actions/cache@v435 with:36 path: |37 ~/Library/Caches/org.swift.swiftpm38 .build39 key: spm-HASH_OF_RESOLVED40 restore-keys: spm-41 42 - name: Build43 run: |44 xcodebuild build-for-testing \45 -scheme MyApp \46 -destination 'platform=iOS Simulator,name=iPhone 15' \47 -derivedDataPath DerivedData \48 | xcpretty49 50 - name: Unit Tests51 run: |52 xcodebuild test-without-building \53 -scheme MyApp \54 -destination 'platform=iOS Simulator,name=iPhone 15' \55 -derivedDataPath DerivedData \56 -resultBundlePath TestResults \57 | xcpretty58 59 - name: Upload Results60 if: always()61 uses: actions/upload-artifact@v462 with:63 name: test-results64 path: TestResults.xcresultEaster Egg
Gizli bir bilgi buldun!
Bu bölümde gizli bir bilgi var. Keşfetmek ister misin?
4. Xcode Cloud
Apple'in native CI/CD cozumu:
swift
1// ci_scripts/ci_post_clone.sh2#!/bin/bash3 4# SPM resolve5xcodebuild -resolvePackageDependencies6 7# Environment degiskenleri8# CI_PRODUCT -> urun adi9# CI_BRANCH -> branch adi10# CI_COMMIT -> commit hash11# CI_BUILD_NUMBER -> build numarasi12# CI_WORKFLOW -> workflow adi13 14echo "Building branch: CI_BRANCH_VALUE"15echo "Build number: CI_BUILD_NUMBER_VALUE"Xcode Cloud vs GitHub Actions
Ozellik | Xcode Cloud | GitHub Actions |
|---|---|---|
**Setup** | GUI, kolay | YAML, esnek |
**macOS** | Apple silicon | Intel (14'te AS) |
**Ucret** | 25 saat/ay ucretsiz | 2000 dk/ay ucretsiz |
**Entegrasyon** | Xcode native | Marketplace |
**Code signing** | Otomatik | Manuel (Fastlane) |
**TestFlight** | Otomatik | Fastlane ile |
**Esneklik** | Sinirli | Cok esnek |
**3rd party** | Sinirli | Sinirsiz |
5. Fastlane Otomasyonu
Fastlane, mobil CI/CD'nin standart otomasyon aracidir.
ruby
1# Fastfile2default_platform(:ios)3 4platform :ios do5 desc "Run tests"6 lane :test do7 scan(8 scheme: "MyApp",9 devices: ["iPhone 15"],10 code_coverage: true,11 output_types: "html,junit",12 clean: true13 )14 end15 16 desc "Beta deployment to TestFlight"17 lane :beta do18 # Build number artir19 increment_build_number(20 build_number: latest_testflight_build_number + 121 )22 23 # Build ve archive24 build_app(25 scheme: "MyApp",26 export_method: "app-store",27 clean: true,28 output_directory: "./build"29 )30 31 # TestFlight'a yukle32 upload_to_testflight(33 skip_waiting_for_build_processing: true,34 changelog: "Bug fixes and improvements"35 )36 37 # Slack bildirimi38 slack(39 message: "Yeni beta surumu TestFlight'a yuklendi!",40 channel: "#ios-releases",41 success: true42 )43 end44 45 desc "Release to App Store"46 lane :release do47 # Testleri calistir48 test49 50 # Screenshot al51 snapshot52 53 # Build54 build_app(55 scheme: "MyApp",56 export_method: "app-store"57 )58 59 # App Store'a yukle60 upload_to_app_store(61 force: true,62 submit_for_review: true,63 automatic_release: false,64 submission_information: {65 add_id_info_uses_idfa: false66 }67 )68 end69 70 # Hata durumunda71 error do |lane, exception|72 slack(73 message: "CI basarisiz: lane_name",74 channel: "#ios-alerts",75 success: false76 )77 end78end6. Code Signing Yonetimi
iOS code signing en karmasik konulardan biridir. Fastlane Match ile merkezi yonetim yapilabilir.
ruby
1# Matchfile2git_url("https://github.com/org/certificates")3storage_mode("git")4type("appstore")5app_identifier(["com.company.app", "com.company.app.widget"])6username("[email protected]")7 8# Kullanim:9# fastlane match appstore -> App Store sertifikalari10# fastlane match development -> Development sertifikalari11# fastlane match adhoc -> Ad Hoc sertifikalariSigning Turleri
Tur | Kullanim | Provisioning |
|---|---|---|
**Development** | Xcode debug | Cihaz bazli |
**Ad Hoc** | Internal test | UDID listesi (100 max) |
**Enterprise** | Sirket ici | Sinirsiz cihaz |
**App Store** | Production | Apple dagitiyor |
7. Otomatik Test Stratejisi
Test Piramidi
swift
1 / E2E \ <- %10 (UI Test, yavas)2 / Integration \ <- %20 (API, DB)3 / Unit Tests \ <- %70 (Hizli, cok)CI'da Test Stratejisi
Test Turu | Ne Zaman | Sure | Kritiklik |
|---|---|---|---|
Lint | Her PR | 1 dk | Zorunlu |
Unit Test | Her PR | 3 dk | Zorunlu |
Snapshot Test | Her PR | 5 dk | Onerilen |
UI Test | Main merge | 15 dk | Onerilen |
E2E Test | Release oncesi | 30 dk | Kritik |
Performance Test | Haftalik | 20 dk | Izleme |
8. Beta Dagitim
TestFlight Best Practices
- Internal test grubu: Gelistirme ekibi (aninda)
- External test grubu: QA ve stakeholder (review sonrasi)
- Public link: Genis beta (10.000 kullanici limiti)
- Test notlari her build icin yazilmali
- Crash raporlarini TestFlight Connect'ten izleyin
9. Release Yonetimi
Semantic Versioning
- Major: (2.0.0): Breaking change, buyuk ozellik
- Minor: (1.3.0): Yeni ozellik, geriye uyumlu
- Patch: (1.3.1): Bug fix
Release Checklist
- Tum testler geciyor
- Release notes yazildi
- Screenshot'lar guncellendi
- Privacy label dogru
- Build number arttirildi
- Code signing dogrulandi
- Regression test tamamlandi
- Stakeholder onayi alindi
10. Monitoring ve Rollback
Release Sonrasi Izleme
Yeni surum yayinlandiktan sonra ilk 48 saat kritiktir:
- Crash rate normal mi? (< %0.1)
- ANR rate artis gosteriyor mu?
- Kullanici sikayetleri var mi? (App Store reviews)
- Revenue etkisi var mi?
Rollback Stratejisi
iOS'ta gercek rollback yoktur. Secenekler:
- Phased release: durdurma (App Store Connect)
- Hotfix: surum cikarma (expedited review)
- Feature flag: ile sorunlu ozelligi kapatma
- Server-side config: ile davranisi degistirme
11. Sonuc ve Oneriler
Mobile DevOps, uygulamanizin kalitesini ve ekibinizin verimliligi dogrudan etkiler. Kucuk baslayip zamanla olgunlastirin.
Olgunluk Yol Haritasi
- Hafta 1: CI pipeline kur (lint + build + unit test)
- Ay 1: CD ekle (TestFlight otomasyonu)
- Ay 3: Code signing otomasyonu (Fastlane Match)
- Ay 6: Feature flags, phased release
- Yil 1: Release trains, automated rollback
ALTIN İPUCU
Bu yazının en değerli bilgisi
Bu ipucu, yazının en önemli çıkarımını içeriyor.
Okuyucu Ödülü
Tebrikler! Bu yazıyı sonuna kadar okuduğun için sana özel bir hediyem var:

