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

BitriseでFastlane/Gradleプラグインの統合テスト

Kenta Kase
September 03, 2019

 BitriseでFastlane/Gradleプラグインの統合テスト

Bitrise User Group Meetup #2での発表スライド
https://bitrise-japan.connpass.com/event/141052/

Kenta Kase

September 03, 2019
Tweet

More Decks by Kenta Kase

Other Decks in Programming

Transcript

  1. BitriseͰFastlane/
    GradleϓϥάΠϯͷ

    ౷߹ςετ
    2019/09/03 Bitrise User Group Meetup #2

    Ճ੉݈ଠ @Kesin11

    View full-size slide

  2. ࣗݾ঺հ
    • ॴଐɿDeNAͷSWETνʔϜ

    • Twitterɿ@Kesin11

    • GitHubɿKesin11

    • ͓࢓ࣄɿݱࡏ͸CI/CD׆༻αϙʔτɺؔ࿈ٕज़ͳͲͷ
    ݕূ

    • ൒೥લ·Ͱ͸QAνʔϜͷࣗಈԽαϙʔτ

    View full-size slide

  3. ϓϥοτϑΥʔϜ͔Β

    ϦδΣΫτ͞ΕΔϦεΫΛ
    νΣοΫͰ͖Δࣾ಺πʔϧΛ
    ࡞੒͠·ͨ͠

    View full-size slide

  4. ͱ͍͏࿩ΛiOSDC 2019Ͱ͢Δ
    ༧ఆͰ͢
    • ࠓ೔͸ͦͷπʔϧͷCI/CDͷ࿩
    https://fortee.jp/iosdc-japan-2019/proposal/d51e7062-2eb1-4a86-bf5f-4928fa3b04c8

    View full-size slide

  5. AppChecker͕νΣοΫ͢Δ಺༰
    • iOS
    • XcodeɺiOS SDK͕ཁٻόʔδϣϯҎ্͔

    • PrivateFrameworkΛ࢖͍ͬͯͳ͍͔

    • Android
    • targetSdkVersion͕ཁٻόʔδϣϯҎ্͔

    • ෆඞཁʹϓϥΠόγʔʹ௚݁͢ΔpermissionΛऔಘ͍ͯ͠ͳ͍͔

    • ৄ͍͠࿩͸iOSDCͰʂ

    View full-size slide

  6. ࣾ಺Ͱ޿͘࢖ΘΕΔπʔϧͷͨΊ
    ςετ΋͔ͬ͠Γॻ͍͍ͯ͘

    View full-size slide

  7. Ϣχοτςετ

    View full-size slide

  8. Ϣχοτςετ
    • ֎෦ͷґଘ͸mockʢ޿ٛʣ͢Δ

    • ྫ: Xcodeͷόʔδϣϯ͸ipaͷInfo.plistͷ஋ΛνΣοΫ͍ͯ͠Δ

    • DTXcode: "1010" -> Xcode 10.1ͰϏϧυ͞Εͨ

    • Info.plistΛύʔεͯ͠࡞ΒΕͨGem::VersionΦϒδΣΫτΛ࢖༻ͯ͠

    Ϗϧυͨ͠Xcodeͷόʔδϣϯ͕ݹ͗͢ͳ͍͔νΣοΫ

    • ςετͰ͸μϛʔͷ஋Ͱੜ੒ͨ͠Gem::VersionΦϒδΣΫτΛ࢖༻ͯ͠
    όʔδϣϯൺֱͷϩδοΫ͕ਖ਼͍͜͠ͱΛݕূ

    • ຊ෺ͷInfo.plistΛ༻ҙ͠ͳͯ͘΋ϩδοΫͷςετ͕Ͱ͖Δ

    View full-size slide

  9. ϢχοτςετͰΧόʔ

    Ͱ͖ͳ͍͜ͱ

    View full-size slide

  10. ϢχοτςετͰΧόʔͰ͖ͳ
    ͍͜ͱ
    • ࣮ࡍʹπʔϧΛ࣮ߦͯ͠Τϥʔ͕ى͖ͳ͍͔

    • ༷ʑͳ֎෦πʔϧΛݺͼग़͍ͯ͠ΔͷͰ݁ߏෆ҆

    • unzip, grep, xcrun, otoolͳͲ

    • Ϗϧυ؀ڥ͕৽͘͠ͳͬͨ৔߹ʹΤϥʔ͕ى͖ͳ͍͔

    • ಛʹXcodeͷόʔδϣϯΛ্͛ͨͱ͖

    View full-size slide

  11. AppCheckerͷछྨ
    • iOS

    • FastlaneϓϥάΠϯɺgemελϯυΞϩϯ൛

    • Android

    • GradleϓϥάΠϯɺgemελϯυΞϩϯ൛

    • ελϯυΞϩϯ൛͕ඞཁͳཧ༝

    • Fastlane/GradleΛ࢖༻͍ͯ͠ͳ͍ήʔϜλΠτϧ༻

    View full-size slide

  12. AppCheckerͷछྨ
    • όϦΤʔγϣϯ͕ଟ͍

    • ߴ͍҆ఆੑ͕ٻΊΒΕ͍ͯΔ

    • ଞνʔϜͷϏϧυϑϩʔʹ૊ΈࠐΜͰ΋Β͏ͨΊ

    • νΣοΫϩδοΫ͸શͯϢχοτςετΛ

    ॻ͍͕ͨͦΕͰ΋ෆ҆

    View full-size slide

  13. BitriseͰ౷߹ςετ
    Logo by https://www.bitrise.io/presskit

    View full-size slide

  14. BitriseͰ౷߹ςετ
    • pull-req͝ͱʹ࣮ࡍͷipa/apkʹରͯ͠AppCheckerΛ࣮ߦ

    • Τϥʔແ͠Ͱ׬૸Ͱ͖Δ͔

    • νΣοΫ݁ՌͷHTMLϨϙʔτ͕ੜ੒͞Ε͍ͯΔ͔

    • αϯϓϧΞϓϦΛຖճϏϧυͯ͠ipa/apkΛੜ੒

    • BitriseͰςετ͠΍͘͢͢ΔͨΊʹΞϓϦͷίʔυ͸
    AppCheckerͷϦϙδτϦ಺ʹؚΊͯ͠·͏ํࣜ

    View full-size slide

  15. BitriseͰ౷߹ςετʢiOSʣ
    1.FastlaneϓϥάΠϯΛϩʔΧϧ͔ΒΠϯετʔϧ

    2.αϯϓϧΞϓϦϏϧυ

    3.Fastlane൛Λ࣮ߦ

    4.ελϯυΞϩϯ൛Λ࣮ߦ

    5.exit 0 && HTMLϨϙʔτ͕ੜ੒͞Ε͍ͯΔ͜ͱΛ֬ೝ

    View full-size slide

  16. BitriseͰ౷߹ςετʢiOSʣ
    1.FastlaneϓϥάΠϯΛϩʔΧϧ͔ΒΠϯετʔϧ
    2.αϯϓϧΞϓϦϏϧυ

    3.Fastlane൛Λ࣮ߦ

    4.ελϯυΞϩϯ൛Λ࣮ߦ

    5.exit 0 && HTMLϨϙʔτ͕ੜ੒͞Ε͍ͯΔ͜ͱΛ֬ೝ

    View full-size slide

  17. BitriseͰ౷߹ςετʢiOSʣ
    1.FastlaneϓϥάΠϯΛϩʔΧϧ͔ΒΠϯετʔϧ

    2.αϯϓϧΞϓϦϏϧυ
    3.Fastlane൛Λ࣮ߦ
    4.ελϯυΞϩϯ൛Λ࣮ߦ

    5.exit 0 && HTMLϨϙʔτ͕ੜ੒͞Ε͍ͯΔ͜ͱΛ֬ೝ

    View full-size slide

  18. BitriseͰ౷߹ςετʢiOSʣ
    1.FastlaneϓϥάΠϯΛϩʔΧϧ͔ΒΠϯετʔϧ

    2.αϯϓϧΞϓϦϏϧυ

    3.Fastlane൛Λ࣮ߦ

    4.ελϯυΞϩϯ൛Λ࣮ߦ
    5.exit 0 && HTMLϨϙʔτ͕ੜ੒͞Ε͍ͯΔ͜ͱΛ֬ೝ

    View full-size slide

  19. BitriseͰ౷߹ςετʢAndroidʣ
    1.gradlew publishToMavenLocalͰϩʔΧϧ
    mavenʹpublish

    2.αϯϓϧΞϓϦϏϧυ + AppCheckerΛ࣮ߦ

    3.ελϯυΞϩϯ൛Λ࣮ߦ

    4.exit 0 && HTMLϨϙʔτ͕ੜ੒͞Ε͍ͯΔ͜ͱΛ
    ֬ೝ

    View full-size slide

  20. BitriseͰ౷߹ςετʢAndroidʣ
    1.gradlew publishToMavenLocalͰϩʔΧϧ
    mavenʹpublish
    2.αϯϓϧΞϓϦϏϧυ + AppCheckerΛ࣮ߦ

    3.ελϯυΞϩϯ൛Λ࣮ߦ

    4.exit 0 && HTMLϨϙʔτ͕ੜ੒͞Ε͍ͯΔ͜ͱΛ
    ֬ೝ

    View full-size slide

  21. BitriseͰ౷߹ςετʢAndroidʣ
    2.αϯϓϧΞϓϦϏϧυ + AppCheckerΛ࣮ߦ
    3.ελϯυΞϩϯ൛Λ࣮ߦ

    4.exit 0 && HTMLϨϙʔτ͕ੜ੒͞Ε͍ͯΔ͜
    ͱΛ֬ೝ

    View full-size slide

  22. BitriseͰ౷߹ςετʢAndroidʣ
    1.publishToMavenLocalͰϩʔΧϧmavenʹ
    publish

    2.αϯϓϧΞϓϦϏϧυ + AppCheckerΛ࣮ߦ

    3.ελϯυΞϩϯ൛Λ࣮ߦ
    4.exit 0 && HTMLϨϙʔτ͕ੜ੒͞Ε͍ͯΔ͜ͱ
    Λ֬ೝ

    View full-size slide

  23. खݩͰࢼ͞ͳͯ͘΋

    ҆৺ͯ͠Ϛʔδ

    Ͱ͖ΔΑ͏ʹͳΓ·ͨ͠

    View full-size slide

  24. ҆৺ͯ͠։ൃͰ͖ΔΑ͏ʹ
    ͳͬͨͷͰ
    ϦϦʔε࡞ۀ΋ࣗಈԽ

    View full-size slide

  25. ϒϥϯνઓུ
    • feature, develop, master

    • ػೳ։ൃpull-reqɿdevelop <- feature

    • ౷߹ςετΛ࣮ߦ

    • ϦϦʔεpull-reqɿmaster <- develop

    • ࣗಈϦϦʔε࡞ۀ

    View full-size slide

  26. ϦϦʔε࡞ۀͷࣗಈԽ
    • iOS͸githubɺAndroid͸ࣾ಺maven

    • masterϚʔδͰόʔδϣϯ൪߸Λ୯७૿Ճ

    • ྫ: 1.13.0 -> 1.14.0

    • ηϚϯςΟοΫόʔδϣχϯά͸ෆཁ

    • ϓϥοτϑΥʔϜଆͷ࠷৽ࣄ৘ʹରԠ͢ΔͨΊɺ

    ৗʹ࠷৽൛Λ࢖͏લఏ

    View full-size slide

  27. ϦϦʔε࡞ۀͷࣗಈԽ
    • gemͱgradleͷόʔδϣϯΛߋ৽

    • gemόʔδϣϯߋ৽ɿBump::Bump.next_version("minor")

    • ଞͷඞཁͳϑΝΠϧΛਖ਼نදݱͰॻ͖׵͑

    • iOSɿmasterʹpush

    • Androidɿࣾ಺mavenʹpublish

    • git tagΛ࡞੒ͯ͠push

    View full-size slide

  28. ϦϦʔεϊʔτͷ࡞੒
    • GitHubͷϦϦʔεϖʔδ͔ΒλάΛબ୒

    • ϦϦʔεϊʔτΛॻ͘ʢ·ͩखಈ...ʣ

    View full-size slide

  29. ·ͱΊ
    • Fastlane/GradleϓϥάΠϯͷ౷߹ςετͱ

    ϦϦʔεࣗಈԽΛBitriseͰ࣮ݱ

    • Ϗϧυͱಉ͡؀ڥͰςετ͍ͯ͠ΔͷͰ҆৺

    • Ϣχοτςετɺ౷߹ςετΛద੾ʹ࢖͍෼
    ͚·͠ΐ͏

    View full-size slide