Tüm Yazılar
KategoriDevOps
Okuma Süresi
25 dk okuma
Yayın Tarihi
...
Kelime Sayısı
1.664kelime

Kahveni hazırla - bu içerikli bir makale!

iOS ve mobil projeler icin DevOps stratejileri. CI/CD pipeline, otomatik test, code signing, beta dagitim ve release yonetimi.

Mobile DevOps Best Practices: CI/CD, Automation ve Release

# 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


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 Acildi
2 --> 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 Check
8 
9Main Branch Merge
10 --> Build(Release) [8 dk]
11 --> Full Test Suite [15 dk]
12 --> Archive [5 dk]
13 --> TestFlight Upload [3 dk]
14 --> Slack Bildirim
15 
16Release Tag
17 --> Clean Build [10 dk]
18 --> Regression Tests [20 dk]
19 --> Archive + Sign [5 dk]
20 --> App Store Upload [3 dk]
21 --> Release Notes

3. GitHub Actions ile iOS CI

yaml
1# .github/workflows/ios-ci.yml
2name: iOS CI
3 
4on:
5 pull_request:
6 branches: [main, develop]
7 push:
8 branches: [main]
9 
10concurrency:
11 group: ios-ci-PR_NUMBER
12 cancel-in-progress: true
13 
14jobs:
15 lint:
16 runs-on: macos-14
17 steps:
18 - uses: actions/checkout@v4
19 - name: SwiftLint
20 run: |
21 brew install swiftlint
22 swiftlint lint --strict
23 
24 build-and-test:
25 needs: lint
26 runs-on: macos-14
27 steps:
28 - uses: actions/checkout@v4
29 
30 - name: Select Xcode
31 run: sudo xcode-select -s /Applications/Xcode_15.4.app
32 
33 - name: Cache SPM
34 uses: actions/cache@v4
35 with:
36 path: |
37 ~/Library/Caches/org.swift.swiftpm
38 .build
39 key: spm-HASH_OF_RESOLVED
40 restore-keys: spm-
41 
42 - name: Build
43 run: |
44 xcodebuild build-for-testing \
45 -scheme MyApp \
46 -destination 'platform=iOS Simulator,name=iPhone 15' \
47 -derivedDataPath DerivedData \
48 | xcpretty
49 
50 - name: Unit Tests
51 run: |
52 xcodebuild test-without-building \
53 -scheme MyApp \
54 -destination 'platform=iOS Simulator,name=iPhone 15' \
55 -derivedDataPath DerivedData \
56 -resultBundlePath TestResults \
57 | xcpretty
58 
59 - name: Upload Results
60 if: always()
61 uses: actions/upload-artifact@v4
62 with:
63 name: test-results
64 path: TestResults.xcresult

Easter 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.sh
2#!/bin/bash
3 
4# SPM resolve
5xcodebuild -resolvePackageDependencies
6 
7# Environment degiskenleri
8# CI_PRODUCT -> urun adi
9# CI_BRANCH -> branch adi
10# CI_COMMIT -> commit hash
11# CI_BUILD_NUMBER -> build numarasi
12# CI_WORKFLOW -> workflow adi
13 
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# Fastfile
2default_platform(:ios)
3 
4platform :ios do
5 desc "Run tests"
6 lane :test do
7 scan(
8 scheme: "MyApp",
9 devices: ["iPhone 15"],
10 code_coverage: true,
11 output_types: "html,junit",
12 clean: true
13 )
14 end
15 
16 desc "Beta deployment to TestFlight"
17 lane :beta do
18 # Build number artir
19 increment_build_number(
20 build_number: latest_testflight_build_number + 1
21 )
22 
23 # Build ve archive
24 build_app(
25 scheme: "MyApp",
26 export_method: "app-store",
27 clean: true,
28 output_directory: "./build"
29 )
30 
31 # TestFlight'a yukle
32 upload_to_testflight(
33 skip_waiting_for_build_processing: true,
34 changelog: "Bug fixes and improvements"
35 )
36 
37 # Slack bildirimi
38 slack(
39 message: "Yeni beta surumu TestFlight'a yuklendi!",
40 channel: "#ios-releases",
41 success: true
42 )
43 end
44 
45 desc "Release to App Store"
46 lane :release do
47 # Testleri calistir
48 test
49 
50 # Screenshot al
51 snapshot
52 
53 # Build
54 build_app(
55 scheme: "MyApp",
56 export_method: "app-store"
57 )
58 
59 # App Store'a yukle
60 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: false
66 }
67 )
68 end
69 
70 # Hata durumunda
71 error do |lane, exception|
72 slack(
73 message: "CI basarisiz: lane_name",
74 channel: "#ios-alerts",
75 success: false
76 )
77 end
78end

6. Code Signing Yonetimi

iOS code signing en karmasik konulardan biridir. Fastlane Match ile merkezi yonetim yapilabilir.

ruby
1# Matchfile
2git_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 sertifikalari
10# fastlane match development -> Development sertifikalari
11# fastlane match adhoc -> Ad Hoc sertifikalari

Signing 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

  1. Hafta 1: CI pipeline kur (lint + build + unit test)
  2. Ay 1: CD ekle (TestFlight otomasyonu)
  3. Ay 3: Code signing otomasyonu (Fastlane Match)
  4. Ay 6: Feature flags, phased release
  5. 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:

Etiketler

#DevOps#CI/CD#Automation#Fastlane#GitHub Actions#Xcode Cloud#iOS
Muhittin Çamdalı

Muhittin Çamdalı

Senior iOS Developer

12+ yıllık deneyime sahip iOS Developer. Swift, SwiftUI ve modern iOS mimarileri konusunda uzman. Apple platformlarında performanslı ve kullanıcı dostu uygulamalar geliştiriyorum.

iOS Geliştirme Haberleri

Haftalık Swift tips, SwiftUI tricks ve iOS best practices. Spam yok, sadece değerli içerik.

Gizliliğinize saygı duyuyoruz. İstediğiniz zaman abonelikten çıkabilirsiniz.

Paylaş

Bunu da begenebilirsiniz