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

Get Started With Continuous Delivery through Bi...

Get Started With Continuous Delivery through Bitrise and DeployGate

Matsuda Jumpei

July 30, 2019
Tweet

More Decks by Matsuda Jumpei

Other Decks in Programming

Transcript

  1. ࣗݾ঺հ Jumpei Matsuda / Daruma ▸ Software Engineer @DeployGate ▸

    GitHub: jmatsu ▸ Twitter: red_fat_daruma ▸ ιϑτ΢ΣΞอकपΓʹؔ৺ ▸ ྉཧͱ೔ຊञͱϏʔϧ(ಛʹϕϧΪʔ)͕޷͖ ▸ ฐࣾTGIF Ͱ࣌ʑྉཧ୲౰ ▸ ञଂ८Γɺࠃ಺֎ͷ Brewery ८Γ͕झຯ 2
  2. ࠓ೔࢖͏ͷͰɺͦ͏͍͏ͷ͋ΔΜͩͳ֮ͬͯ͑ͯ͘ΕΕ͹ ▸ ഑෍༻ݻఆURLΛൃߦͰ͖Δ ▸ ೚ҙͷόʔδϣϯΛ೚ҙͷλΠϛϯάͰඥ ෇͚Մೳ ▸ ༻్ྫ ▸ QA

    ର৅ͷ੒Ռ෺ͷΈΛ1URL͔Β഑෍ ▸ Feature branch ͝ͱʹ Distribution Λ࡞੒ ͠ɺReviewer ʹࢼͯ͠΋Β͏ ▸ ref: github://DroidKaigi/conference-app-2019 4 ഑෍ϖʔδ
  3. ✌ ࠓ೔࿩͢͜ͱ ▸ ϞόΠϧʹ͓͚Δ Continuous Delivery ͱ͸Կͳͷ͔ ▸ Continuous Integration/Deployment

    ͱͷҧ͍ ▸ ελʔτΞοϓͰ0͔Β࢝ΊΔ CD ▸ ߏஙͨ͠ͱ͖ͷߟ͑ํ ▸ bitrise ͱ DeployGate Ͱ CD Λ࣮ݱͨ͠ͱ͖ͷྫ 5
  4. ࠓ೔࿩͞ͳ͍͜ͱ ▸ ߴ଎Խ Tips ▸ ֤ Distribution Service ͷৄ͍͠ൺֱ ▸

    طଘͷCDͷΤϯϋϯε ▸ DeployGate ͷࡉ͔͍࢖͍ํ ▸ ref: https://devcenter.bitrise.io/deploy/deploy-apps-to-deploygate-from-bitrise/ 6
  5. ▸ ֤ Stage Λ࣮ߦ͢Δ͜ͱͰɺRC Λ࡞͍ͬͯ͘ Deployment Pipeline ͰݟΔ Continuous Delivery

    Deployment Pipeline ྫ 9 UNIT TEST STATIC ANALYSIS UI TEST BUILD ACCEPTANCE TEST PRODUCTION FARM QA, PUBLIC BETA Increase Product Quality/Reliability Send feedback Approved!
  6. ▸ ֤ Stage Λ࣮ߦ͢Δ͜ͱͰɺRC Λ࡞͍ͬͯ͘ 10 UNIT TEST STATIC ANALYSIS

    UI TEST BUILD ACCEPTANCE TEST PRODUCTION FARM QA, PUBLIC BETA Increase Product Quality/Reliability Send feedback Approved! Deployment Pipeline ͰݟΔ Continuous Delivery Deployment Pipeline ྫ
  7. ▸ ֤ Stage Λ࣮ߦ͢Δ͜ͱͰɺRC Λ࡞͍ͬͯ͘ 11 UNIT TEST STATIC ANALYSIS

    UI TEST BUILD ACCEPTANCE TEST PRODUCTION FARM QA, PUBLIC BETA Increase Product Quality/Reliability Send feedback Approved! Deployment Pipeline ͰݟΔ Continuous Delivery Deployment Pipeline ྫ
  8. ▸ ͜ͷྲྀΕΛ܁Γฦ͍ͯ͘͜͠ͱͰɺ࣭ͱ৴པ౓Λ্͛Δ 12 UNIT TEST STATIC ANALYSIS UI TEST BUILD

    ACCEPTANCE TEST PRODUCTION FARM QA, PUBLIC BETA Increase Product Quality/Reliability Send feedback Approved! Deployment Pipeline ͰݟΔ Continuous Delivery Deployment Pipeline ྫ
  9. ▸ ͜ͷྲྀΕΛ܁Γฦ͍ͯ͘͜͠ͱͰɺ࣭ͱ৴པ౓Λ্͛Δ 13 UNIT TEST STATIC ANALYSIS UI TEST BUILD

    ACCEPTANCE TEST PRODUCTION FARM QA, PUBLIC BETA Increase Product Quality/Reliability Send feedback Approved! Deployment Pipeline ྫ Deployment Pipeline ͰݟΔ Continuous Delivery
  10. ▸ ͜ͷྲྀΕΛ܁Γฦ͍ͯ͘͜͠ͱͰɺ࣭ͱ৴པ౓Λ্͛Δ 14 UNIT TEST STATIC ANALYSIS UI TEST BUILD

    ACCEPTANCE TEST PRODUCTION FARM QA, PUBLIC BETA Increase Product Quality/Reliability Send feedback Approved! Deployment Pipeline ͰݟΔ Continuous Delivery Deployment Pipeline ྫ
  11. 15 UNIT TEST STATIC ANALYSIS UI TEST BUILD ACCEPTANCE TEST

    PRODUCTION FARM QA, PUBLIC BETA Increase Product Quality/Reliability Send feedback Approved! ▸ ͳΜΒ͔ͷ߹ҙͷݩʹɺRC Λ Production ΁σϓϩΠ Deployment Pipeline ͰݟΔ Continuous Delivery Deployment Pipeline ྫ
  12. ▸ RC Λ Production ΁खಈͰσϓϩΠग़དྷΔঢ়ଶ·ͰࣗಈԽ Continuous Delivery ͱ͸ʁ 16 UNIT

    TEST STATIC ANALYSIS UI TEST BUILD ACCEPTANCE TEST PRODUCTION FARM QA, PUBLIC BETA Increase Product Quality/Reliability Send feedback Approved! Deployment Pipeline ͰݟΔ Continuous Delivery
  13. ▸ ࣗಈԽ͞ΕΔൣғ ▸ ৽͍͠มߋͷݕূ ʙ Production σϓϩΠͷલ४උ ▸ ϞόΠϧ։ൃͷ৔߹ɺDelivery ର৅͸

    Archive ▸ ࣮ߦ؀ڥͷϏϧυͳͲ͸ඞཁͳ͍ ▸ νʔϜαΠζʹؔΘΒͣɺૣ͍ஈ֊Ͱ Continuous Delivery Λ࣮ݱͯ͠ ͓͘ͱྑ͍ ▸ ͳͥ Continuous Integration ΍ Continuous Deployment Ͱ͸ͳ͍ͷ͔ 17 Deployment Pipeline ͰݟΔ Continuous Delivery Continuous Delivery ͱ͸ʁ
  14. ▸ ࣗಈԽ͞ΕΔൣғ ▸ ৽͍͠มߋͷݕূ ʙ Production σϓϩΠͷલ४උ ▸ ϞόΠϧ։ൃͷ৔߹ɺDelivery ର৅͸

    Archive ▸ ࣮ߦ؀ڥͷϏϧυͳͲ͸ඞཁͳ͍ ▸ νʔϜαΠζʹؔΘΒͣɺૣ͍ஈ֊Ͱ Continuous Delivery Λ࣮ݱͯ͠ ͓͘ͱྑ͍ ▸ ͳͥ Continuous Integration ΍ Continuous Deployment Ͱ͸ͳ͍ͷ͔ 18 Deployment Pipeline ͰݟΔ Continuous Delivery Continuous Delivery ͱ͸ʁ
  15. ▸ ৽͍͠มߋΛݕূ͢Δ Stages ͕ࣗಈԽ͞Εͨঢ়ଶ Continuous Integration 19 UNIT TEST STATIC

    ANALYSIS UI TEST BUILD ACCEPTANCE TEST PRODUCTION FARM QA, PUBLIC BETA Increase Product Quality/Reliability Send feedback Approved! Deployment Pipeline ͰݟΔ Continuous Integration
  16. Continuous Integration Ͱ͸ͳ͍ཧ༝ ▸ ଞ։ൃऀ΍ଞεςʔΫϗϧμʔ͕มߋͷݕূΛͮ͠Β͍ ▸ Ϗϧυ͠௚͠ɺखͰ੒Ռ෺Λμ΢ϯϩʔυɾɾɾ ▸ Release Candidate

    Λ࡞Δ Stage ͸ఆٛͷ֎ʹ͋Δ ▸ Continuous Integration ͕͋Δ => ϦϦʔεͰ͖Δϓϩμ Ϋτʹͳ͍ͬͯΔ ͸੒Γཱͨͳ͍ 20 Deployment Pipeline ͰݟΔ Continuous Integration
  17. ▸ RC ͕Ͱ͖ɺProduction ΁σϓϩΠ͢Δ·Ͱ͕શࣗಈ Continuous Deployment 21 UNIT TEST STATIC

    ANALYSIS UI TEST BUILD ACCEPTANCE TEST PRODUCTION FARM QA, PUBLIC BETA Increase Product Quality/Reliability Send feedback Automated Deployment Pipeline ͰݟΔ Continuous Deployment
  18. Continuous Deployment Ͱ͸ͳ͍ཧ༝ ▸ ೉қ౓ߴ : ߴ৴པ౓ͳࣗಈςετ΍ϞχλϦϯάͷ࢓૊Έ ▸ ఆٛతʹ͸ɺਓʹΑΔQAͳͲ͕ൣғ֎ ▸

    Backend ͷ։ൃͱ໌Β͔ʹࣄ৘͕ҟͳΔ໘΋ ▸ Production ʹσϓϩΠ == Ϣʔβʔ͸Ξοϓσʔτඞਢ ▸ ߴස౓͗ͯ͢ΞϯΠϯετʔϧ͞ΕͨΒҙຯ͕ͳ͍ ▸ ݹ͍όʔδϣϯ͕͜ͷੈʹऔΓ࢒͞ΕΔ͜ͱ͸લఏ ▸ ϦϦʔεϊʔτͲ͏͢Δ໰୊ etc. 22 Deployment Pipeline ͰݟΔ Continuous Deployment
  19. খٳࢭ ▸ ͜͜·Ͱ ▸ ͳʹ͕/ͳͥ Continuous Delivery ͳͷ͔ ▸ ͔͜͜Β

    ▸ Ͳ͏΍ͬͯ Delivery ͷ෦෼Λߏங͍͔ͯ͘͠ 23
  20. Delivery ઌΛܾΊΔઓུ ͲͷαʔϏεΛ࢖ͬͯ഑෍͢Δ͔ ▸ Delivery ઌ͸ʮ୭͕Πϯετʔϧ͢Δͷ͔ʯʹґଘ ▸ ഑෍αʔϏε΁ͷཁٻ ▸ IT

    Ϧςϥγʔ΍഑෍ʹؔ͢Δ஌ࣝ ▸ ഑෍αʔϏεͨͪ ▸ Play Store Internal Tracks, Internal app sharing, Test Flight, DeployGate, Fabric beta, Updraft, CI/CD services like bitrise, any storage services, etc. 24
  21. e.g. ΤϯδχΞ΍ QAνʔϜͷཁٻ 25 Public Beta Testers Sales Directors QAs

    Designers Engineers ‣উखʹ։ൃதͷόʔδϣϯΛ৮ͬͯόάใࠂ͠ͳ͍Ͱ΄͠ ͍ ‣ ϝϯόʔ؅ཧ͍ͨ͠ ‣ ഑෍ͷͨͼʹૢ࡞ͨ͘͠ͳ͍ ‣ ΊΜͲ͍͘͞ͷͰউखʹ΍ͬͯ΄͍͠ ‣ۓٸ౓ͷߴ͘ͳ͍ใࠂ͸௚઀དྷͯ΄͘͠ͳ͍ ‣ લͷόʔδϣϯͷڍಈΛݟ͍ͨ ‣ ഑෍όʔδϣϯ͝ͱʹ෼͔Γ΍͍ࣝ͢ผࢠ͕ཉ͍͠ ‣ QAલʹ͍͍ͪͪΤϯδχΞ͔Β Binary Λ໯Θͣʹελʔτ͍ͨ͠ Delivery ઌΛܾΊΔઓུ
  22. e.g. σΟϨΫλʔ΍ӦۀνʔϜͷཁٻ 26 Public Beta Testers Sales Directors QAs Designers

    Engineers ‣ ϦϦʔε͞ΕͯΔΞϓϦ͕ݟ͍ͨ ‣ ৽ػೳͷڍಈ͕ݟ͍ͨ ‣ ೔ࠒ͔Β Dogfooding ͍ͨ͠ ‣ ҆ఆͯ͠ಈ͘΋ͷ͕৮Γ͍ͨ ‣ ΠϯετʔϧʹखؒऔΓͨ͘ͳ͍ ‣ ະެ։৽ػೳͷചΓࠐΈ͕͍ͨ͠ Delivery ઌΛܾΊΔઓུ
  23. e.g. ΞϓϦΛΠϯετʔϧ͢Δؾ֓ 27 Public Beta Testers Sales Directors QAs Designers

    Engineers ૉૣ͘೚ҙͷ൛Λ Πϯετʔϧ͍ͨ͠ ศརػೳ͕ཉ͍͠ ҆ఆͯ͠ RC Λ Πϯετʔϧ͍ͨ͠ खؒগͳ͘ɺ ৴པͰ͖Δ഑෍ݩ͔Β Πϯετʔϧ͍ͨ͠ Functionality of Distribution service Easy Complexity Delivery ઌΛܾΊΔઓུ
  24. Ͳͷ഑෍αʔϏε͕ྑͦ͞͏͔? (ྫ) 28 Public Beta Testers Sales Directors QAs Designers

    Engineers DeployGate,Fabric beta, bitrise, Internal app sharing, etc. DeployGate's distribution, Official Closed Tracks, etc. Official Internal Tracks, etc. Functionality of Distribution service Easy Complexity Delivery ઌΛܾΊΔઓུ
  25. ߏங͍ͯ͘͠ ▸ Delivery ઌΛܾΊΔ ▸ Branching model ͱ Step ▸

    Step ΍ Workflow ͷઃఆΛ͢Δ ▸ खஈͷબఆɺӡ༻ܾΊɺͦΕʹ߹Θͤͨ CI/CD ͷηοτΞο ϓͷྲྀΕͰ΍Δ 29 ελʔτΞοϓతࣄྫͰߟ͑ͯߏஙͯ͠ΈΔ
  26. ͜ΜͳϓϩδΣΫτͰ΍Γ·ͨ͠ ▸ ΞϓϦະϦϦʔε ▸ iOS/Android Λ XPlatform Ͱಉ࣌ʹ։ൃ ▸ Public

    Beta Test ͷ༧ఆ͸ͳ͠ ▸ ։ൃऀҎ֎ͷ಺෦ͷਓؒ͸৮ΔՄೳੑ༗Γ ▸ Ӧۀ΋৮Δ 30 ελʔτΞοϓతࣄྫͰߟ͑ͯߏஙͯ͠ΈΔ
  27. ▸ Delivery ઌΛܾΊΔ ▸ Branching model ͱ Step ▸ Step

    ΍ Workflow ͷઃఆΛ͢Δ 31 ελʔτΞοϓతࣄྫͰߟ͑ͯߏஙͯ͠ΈΔ ߏங͍ͯ͘͠
  28. εςʔΫϗϧμʔ͝ͱʹཁٻΛݟΔ 32 Sales Directors QAs Designers Engineers ૉૣ͘೚ҙͷ൛Λ Πϯετʔϧ͍ͨ͠ ҆ఆͯ͠

    RC Λ Πϯετʔϧ͍ͨ͠ Functionality of Distribution service Easy Complexity ελʔτΞοϓతࣄྫͰߟ͑ͯߏஙͯ͠ΈΔ - Delivery ઌΛܾΊΔ Public Beta Testers ࠓճ͸ແ͠ νΣοΫର৅͕ ෼͔Γ΍͍͢ํ͕ ͍͍
  29. ར༻αʔϏεΛબఆ 33 Public Beta Testers Sales Directors QAs Designers Engineers

    bitrise distribution Official Closed Tracks Functionality of Distribution service Easy Complexity ࠓճ͸ແ͠ ελʔτΞοϓతࣄྫͰߟ͑ͯߏஙͯ͠ΈΔ - Delivery ઌΛܾΊΔ ഑෍ϖʔδ
  30. ▸ Delivery ઌΛܾΊΔ ▸ Branching model ͱ Step ▸ Step

    ΍ Workflow ͷઃఆΛ͢Δ 34 ελʔτΞοϓతࣄྫͰߟ͑ͯߏஙͯ͠ΈΔ ߏங͍ͯ͘͠
  31. Branching Model and Steps for Deployment 35 Feature branch Sales

    Directors QAs Designers Engineers BUILD Staging branch BUILD merge Engineers Release branch BUILD merge Engineers BUILD tag Engineers ελʔτΞοϓతࣄྫͰߟ͑ͯߏஙͯ͠ΈΔ - Branching model ͱ Step
  32. 36 Feature branch Sales Directors QAs Designers Engineers BUILD Staging

    branch BUILD merge Engineers Release branch BUILD merge Engineers BUILD tag Engineers ελʔτΞοϓతࣄྫͰߟ͑ͯߏஙͯ͠ΈΔ - Branching model ͱ Step Branching Model and Steps for Deployment
  33. Deploy To Bitrise.io ▸ Bitrise ͷ഑෍ػೳΛ༗ޮԽ͢Δ Step ▸ Ϗϧυ͝ͱʹURL͕ൃߦ͞ΕΔ͕ɺ։ൃऀ༻ͳΒ଱͑͏Δ ▸

    ಛʹ feature branch ʹ͸༗༻ ▸ ௨஌ ▸ ࢦఆͨ͠ϩʔϧ΍ϝʔϧΞυϨεʹϝʔϧ͕ૹΕΔ 37 ελʔτΞοϓతࣄྫͰߟ͑ͯߏஙͯ͠ΈΔ - Branching model ͱ Step
  34. 38 Feature branch Sales Directors QAs Designers Engineers BUILD Staging

    branch BUILD merge Engineers Release branch BUILD merge Engineers BUILD tag Engineers ελʔτΞοϓతࣄྫͰߟ͑ͯߏஙͯ͠ΈΔ - Branching model ͱ Step Branching Model and Steps for Deployment
  35. DeployGate Upload ▸ DeployGate ͔Β഑৴͢ΔͨΊͷฐࣾެࣜ Step ▸ ݻఆURLΛൃߦ͓ͯ͘͜͠ͱͰɺ࠶഑෍ͷඞཁ͕ͳ͍ ▸ ಛʹ

    Staging/QA/Designer check ༻ͱͯ͠༗༻ ▸ ௨஌ ▸ iOS ͳΒϝʔϧɺAndroid ͳΒϓογϡ௨஌ ▸ ଞͷ௨஌ͷ৔߹͸ Step Λผ్ೖΕΔ౳ͷରԠ͕ඞཁ 39 ελʔτΞοϓతࣄྫͰߟ͑ͯߏஙͯ͠ΈΔ - Branching model ͱ Step
  36. 40 Feature branch Sales Directors QAs Designers Engineers BUILD Staging

    branch BUILD merge Engineers Release branch BUILD merge Engineers BUILD tag Engineers ελʔτΞοϓతࣄྫͰߟ͑ͯߏஙͯ͠ΈΔ - Branching model ͱ Step Branching Model and Steps for Deployment
  37. 41 Feature branch Sales Directors QAs Designers Engineers BUILD Staging

    branch BUILD merge Engineers Release branch BUILD merge Engineers BUILD tag Engineers ελʔτΞοϓతࣄྫͰߟ͑ͯߏஙͯ͠ΈΔ - Branching model ͱ Step Branching Model and Steps for Deployment
  38. Google Play Deploy ▸ Google Play Console ʹΞοϓϩʔυ͢Δ Step ▸

    ※ Console ͷ Owner ͷΈൃߦͰ͖Δ Service account ͕ඞཁ ▸ Internal Tracks ʹରԠ ▸ mapping ϑΝΠϧ΍ϦϦʔεϊʔτ΋͋͛ΒΕΔ 42 ελʔτΞοϓతࣄྫͰߟ͑ͯߏஙͯ͠ΈΔ - Branching model ͱ Step
  39. Deploy to iTunes Connect - Application Loader ▸ iTunes Connect

    ʹΞʔΧΠϒΛΞοϓϩʔυ͢Δ͚ͩͷ Step ▸ ϦϦʔεϊʔτͳͲ΋ѻ͑Δ Step ͸ผ ▸ ࠓճ͸Ξοϓϩʔυ͢Δૉࡐ͕ͳ͗ͨ͢͞ͷͰɺͪ͜Βʹ 43 ελʔτΞοϓతࣄྫͰߟ͑ͯߏஙͯ͠ΈΔ - Branching model ͱ Step
  40. ▸ Delivery ઌΛܾΊΔ ▸ Branching model ͱ Step ▸ Step

    ΍ Workflow ͷઃఆΛ͢Δ 44 ελʔτΞοϓతࣄྫͰߟ͑ͯߏஙͯ͠ΈΔ ߏங͍ͯ͘͠
  41. Deploy To Bitrise.io ▸ ࠷௿ݶɺ௨஌ઌΛઃఆ͢Ε͹Α͍ ▸ ҎԼ͸ൈਮ 45 Notify: User

    Roles developers Enable public page for the App? FALSE Compress the artifacts into one file? FALSE ελʔτΞοϓతࣄྫͰߟ͑ͯߏஙͯ͠ΈΔ - Steps ͷઃఆΛ͢Δ
  42. DeployGate Upload ▸ Staging ༻ͷ഑෍ϖʔδ͸ web ͔Βઌʹ࡞͓ͬͯ͘ͱྑ͍ ▸ {ANDROID,IOS}_DISTRIBUTION_KEY ͱͯ͠

    App Env ΁ ▸ ҎԼ͸ൈਮ 46 ελʔτΞοϓతࣄྫͰߟ͑ͯߏஙͯ͠ΈΔ - Steps ͷઃఆΛ͢Δ Distribution Key (Staging) ${ANDROID,IOS}_DISTRIBUTION_KEY short message / release note $GIT_CLONE_COMMIT_HASH - $GIT_CLONE_COMMIT_MESSAGE_SUBJECT
  43. Google Play Deploy ▸ ࠷௿ݶɺΞοϓϩʔυͨ͠ binary ΛͲ͜ʹެ։͢Δ͔͚ͩઃఆ͢Δ 47 ελʔτΞοϓతࣄྫͰߟ͑ͯߏஙͯ͠ΈΔ -

    Branching model ͱ Step Track (push to release branch) alpha Track (tag on release branch) rollout
  44. Workflow Setup Strategy ▸ ۪௚ʹ branching model ʹ߹Θͤͯ੾Γग़͢ 48 ελʔτΞοϓతࣄྫͰߟ͑ͯߏஙͯ͠ΈΔ

    - Workflow ͷઃఆΛ͢Δ Feature branch BUILD Staging branch BUILD merge Release branch BUILD merge BUILD tag
  45. Workflow Setup Strategy ▸ ۪௚ʹ branching model ʹ߹Θͤͯ੾Γग़͢ ▸ release

    branch ༻ͷ Workflow ͚ͩ͸खಈ࣮ߦ΋ࢹ໺ʹೖΕͯ෼ׂ 49 ελʔτΞοϓతࣄྫͰߟ͑ͯߏஙͯ͠ΈΔ - Workflow ͷઃఆΛ͢Δ
  46. ·ͱΊ ▸ CD ߏஙͷߟ͑ํ ▸ Πϯετʔϧ͢ΔਓͨͪͷଐੑɾཁٻΛߟ͑Δ ▸ Delivery ઌΛܾΊΔ ▸

    Feature Branch => bitrise, Staging => DeployGate ഑෍ϖʔδ ▸ Branching model Λܾఆ͢Δ ▸ Bitrise Workflow ͷ࡞Γํ ▸ ۪௚ʹ branching model ʹ߹Θͤͯ੾Γग़͢ ▸ ཉ͍͠ Step ͸େମ͋ΔͷͰɺઌʹ΍Γ͍ͨ͜ͱΛݻΊΔͱΑ͍ 50 ͓ΘΓʹ
  47. Thank You for Listening! ▸ Jumpei Matsuda / daruma ▸

    Software Engineer @DeployGate ▸ GitHub: jmatsu ▸ Twitter: red_fat_daruma 52