Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CI/CDをミニマルに構築する

d_date
October 21, 2021

 CI/CDをミニマルに構築する

iOS Test Tea Time #3

d_date

October 21, 2021
Tweet

More Decks by d_date

Other Decks in Programming

Transcript

  1. CI/CDΛϛχϚϧʹߏங͢Δ
    iOS Test TeaTime #3
    Daiki Matsudate
    @d_date

    View full-size slide

  2. ͜ͷτʔΫͷείʔϓ
    ։ൃ؀ڥͷվળ CI/CDͷߏங
    ςετɾ഑෍
    CI/CDͷӡ༻ɾվળ
    #ଟ෼͜ͷtarappo͞Μ͕࿩͢
    Out of Scope
    CI/CDʹର͢Δߟ͑ํ

    View full-size slide

  3. Pull Reqeust͝ͱʹBuild / Test͕੒ޭ͠MergeՄೳͰ͋Δ
    ৗʹmainϒϥϯνͷϏϧυ͕݈߁
    ৗʹProduction΁ͷϦϦʔε͕Մೳ
    https://www.redhat.com/ja/topics/devops/what-is-ci-cd

    View full-size slide

  4. CI / CD͸ͳͥ೉͍͠ͷ͔
    • ੔උ͍ͯ͘͠ΠςϨʔγϣϯ͕௕͍

    • Work
    fl
    owΛʮॻ͘ʯˠʮಈ͔͢ʯˠʮࣦഊ͢Δʯ·Ͱ͕௕͍

    • CLI΍σϑΥϧτͰ͸ͳ͍ݴޠͷηοτΞοϓ

    • ؀ڥม਺

    • iOSͷॺ໊ؔ܎͕΍΍͍͜͠ɺ஌͕ࣝݹ͍

    • ܦݧ஋͕ಘΒΕʹ͍͘

    View full-size slide

  5. CI/CDʹର͢Δߟ͑ํ

    View full-size slide

  6. CI/CDʹର͢Δߟ͑ํ
    අ༻ରޮՌ
    • ͓ۚΛ͔͚Ε͹ϚγϯεϖοΫ͕Α͘ͳΓ࣮ߦ͕࣌ؒ࡟ݮ

    • ࣮ଶʹݟ߹Θͳ͍ߴֹ՝ۚ

    View full-size slide

  7. CI/CDʹର͢Δߟ͑ํ
    ࣌ؒରޮՌ
    • νʔϜਓ਺͕ଟ͍΄ͲޮՌ͸ಘΒΕ΍͍͢

    • Work
    fl
    owͷमਖ਼ʹΑΓ࡟ݮ͞Ε࣮ͨߦ࣌ؒ

    • vs. मਖ਼͢Δͷʹ͔͔ͬͨ࣌ؒ

    • ࣮͸ηοτΞοϓΑΓϝϯςφϯεʹ͕͔͔࣌ؒΔ

    • ߥഇ͢Δ΄Ͳ૲מΓ͸େม

    View full-size slide

  8. ΍Δ΂͖͜ͱ
    • γϯϓϧͳߏ੒ʹ͢Δ

    • ςετͱ഑෍Λͭ͘Δ

    • ༨༟͕͋Ε͹ϥΠϒϥϦͷΞοϓσʔτΛఆظ࣮ߦ͢Δ

    View full-size slide

  9. γϯϓϧͳߏ੒ʹ͢Δ

    View full-size slide

  10. • Swift Package ManagerΛ࢖͏

    • XcodeͷSchemeΛ׆༻͢Δ

    • Automatic Code SigningΛ࢖͏

    • App Store Connect APIΛ࢖͏

    • Test FlightͰ഑෍͢Δ
    Apple PlatformͷCI / CD
    Best Practice

    View full-size slide

  11. • SwiftҎ֎ͷݴޠͷηοτΞοϓ͕ෆཁ
    Swift Package ManagerΛ࢖͏
    xcodebuild -resolvePackageDependencies
    swift package build

    View full-size slide

  12. https://speakerdeck.com/d_date/swift-package-centered-project-build-and-practice

    https://www.youtube.com/watch?v=e_T1-XrYf4A

    View full-size slide

  13. XcodeͷSchemeΛ׆༻͢Δ
    • Scheme = Target x Con
    fi
    guration

    • SchemeΛࢦఆ͢Δ͚ͩͰઃఆΛ੾Γସ͑ΒΕΔ

    View full-size slide

  14. Automatic Code SigningΛ࢖͏
    iOSͷॺ໊ͱ഑෍͸໘౗
    • Certi
    fi
    cate (Development / Production)

    • Provisioning Pro
    fi
    le (Development / Ad hoc / App Store / Enterprise)

    • Team

    • Bundle Identi
    fi
    er (per environment)

    View full-size slide

  15. Automatic Code SigningΛ࢖͏
    Provisioning Pro
    fi
    le͸Dev Portal͔Βऔಘ
    • Certi
    fi
    cate (Development / Production)

    • Provisioning Pro
    fi
    le (Development / Ad hoc / App Store / Enterprise)

    • Team

    • Bundle Identi
    fi
    er (per environment)

    *fastlane matchͱͷซ༻͸ෆՄ

    View full-size slide

  16. App Store Connect APIΛ࢖͏
    Provisioning Pro
    fi
    le͸Dev Portal͔Βऔಘ
    • Certi
    fi
    cate (Development / Production)

    • Provisioning Pro
    fi
    le (Development / Ad hoc / App Store / Enterprise)

    • Team

    • Bundle Identi
    fi
    er (per environment)

    • API Key

    View full-size slide

  17. Test FlightͰ഑෍͢Δ
    https://qiita.com/d_date/items/db540e9ed127b1b23e40

    View full-size slide

  18. ΍Βͳ͍͍ͯ͘͜ͱ
    • CIͷ࣮ߦ࣌ؒ࡟ݮ

    • ී௨͸ઐ೚ऀ͸͍ͳ͍ͷͰ (DeNA SWETάϧʔϓΛআ͘ʣ͜͜͸ؤுΒͳ
    ͍

    • νʔϜϝϯόʔ͕ଟ͘ͳ͖ͬͯͯϏϧυ͕࣌ؒ༗ҙʹ৳ͼͨɺδϣϒ͕٧
    ·Γ࢝ΊͨΒରࡦ͢Δ

    • ʢա౓ͳʣڞ௨Խ

    • ࢖͏͔Ͳ͏͔Θ͔Βͳ͍΋ͷ

    View full-size slide

  19. ςετͱ഑෍Λͭ͘Δ

    View full-size slide

  20. ༨༟͕͋Ε͹ϥΠϒϥϦͷߋ৽

    View full-size slide

  21. ༨༟͕͋Ε͹ϥΠϒϥϦͷߋ৽
    • dependabotͷઃఆʢSwift͸ରԠதʣ

    • Bitrise / GitHub ActionsͰिҰճϏϧυΛճ͢

    • Package.resolvedΛࣺͯͨΒ͏·͍͘͘͸ͣ

    View full-size slide

  22. Flutterͷ৔߹


    ʢ༨༟͕͋Ε͹Voice Onlyʣ

    View full-size slide

  23. ·ͱΊ
    • ϛχϚϜʹߏங͍ͯ͘͠

    • ͦ͏͢Δͱͪΐͬͱͣͭվળ͕͠΍͘͢ͳΔ

    • ඞཁͳ͜ͱ͚ͩΛ΍ΔʢYAGNIʣ

    View full-size slide

  24. References
    • https://qiita.com/d_date/items/a06b5661101460851f4c

    • https://qiita.com/d_date/items/db540e9ed127b1b23e40

    • https://speakerdeck.com/d_date/swift-package-centered-project-build-and-
    practice

    • https://www.youtube.com/watch?v=e_T1-XrYf4A

    View full-size slide