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

Bitrise Stepの作り方

Bitrise Stepの作り方

90ec81078e4fd2b905f8ef0776887afa?s=128

Ryo Sakaguchi

August 16, 2018
Tweet

More Decks by Ryo Sakaguchi

Other Decks in Programming

Transcript

  1. ©2018 Wantedly, Inc. #JUSJTF4UFQͷ࡞Γํ Mobile CI/CD Meetup Ryo Sakaguchi (@wakwak3125)

    2018.8.16 -
  2. ©2018 Wantedly, Inc. HJUIVCSFMFBTFEPXOMPBEFS XBLXBLCJUSJTFTUFQHJUIVCSFMFBTFEPXOMPBEFS

  3. ©2018 Wantedly, Inc.

  4. ©2018 Wantedly, Inc. • GitHub Releases͔ΒͷϑΝΠϧμ΢ϯϩʔυ • tagࢦఆͰͳΜͰ΋μ΢ϯϩʔυͰ͖Δ • latestͰৗʹ࠷৽ͷ΋ͷΛμ΢ϯϩʔυͯ͘͠Δ

    • ෳ਺ϑΝΠϧͷμ΢ϯϩʔυʹରԠ͍ͯ͠Δ Ͱ͖Δ͜ͱ
  5. ϖʔδλΠτϧ ϖʔδαϒλΠτϧ ©2018 Wantedly, Inc. ͳΜͰඞཁ͔ͩͬͨ

  6. ©2018 Wantedly, Inc. 3FMFBTFGMPX ͪΐͬͱલ·Ͱͷ8BOUFEMZ1FPQMFͷ3FMFBTFqPX

  7. ©2018 Wantedly, Inc. Release Workflow Checkout release branch Versioning, 


    Create change logs Merge release branch to master Deploy to Crashlytics Beta Deploy to Google Play 
 internal track Rollout the new app
 (0.5%~) ࣗ෼Ͱ΍Δ fastlaneͷlaneΛखݩͰ࣮ߦ͢Δ GitHubͰ΍Δ BitriseͰfastlane͕΍Δ Slackܦ༝Ͱ
 Bitrise͕fastlaneͰ΍Δ ࣗ෼Ͱ΍Δ
  8. ©2018 Wantedly, Inc. Release Workflow Checkout release branch Versioning, 


    Create change logs Merge release branch to master Deploy to Crashlytics Beta Deploy to Google Play 
 internal track Rollout the new app
 (0.5%~) ࣗ෼Ͱ΍Δ fastlaneͷlaneΛखݩͰ࣮ߦ͢Δ GitHubͰ΍Δ BitriseͰfastlane͕΍Δ Slackܦ༝Ͱ
 Bitrise͕fastlaneͰ΍Δ ࣗ෼Ͱ΍Δ
  9. ©2018 Wantedly, Inc. Release Workflow Checkout release branch Versioning, 


    Create change logs Merge release branch to master Deploy to Crashlytics Beta Deploy to Google Play 
 internal track Rollout the new app
 (0.5%~) ࣗ෼Ͱ΍Δ fastlaneͷlaneΛखݩͰ࣮ߦ͢Δ GitHubͰ΍Δ BitriseͰfastlane͕΍Δ Slackܦ༝Ͱ
 Bitrise͕fastlaneͰ΍Δ ࣗ෼Ͱ΍Δ
  10. ©2018 Wantedly, Inc. Release Workflow Checkout release branch Versioning, 


    Create change logs Merge release branch to master Deploy to Crashlytics Beta Deploy to Google Play 
 internal track Rollout the new app
 (0.5%~) ࣗ෼Ͱ΍Δ fastlaneͷlaneΛखݩͰ࣮ߦ͢Δ GitHubͰ΍Δ BitriseͰfastlane͕΍Δ Slackܦ༝Ͱ
 Bitrise͕fastlaneͰ΍Δ ࣗ෼Ͱ΍Δ
  11. ©2018 Wantedly, Inc. Release Workflow Checkout release branch Versioning, 


    Create change logs Merge release branch to master Deploy to Crashlytics Beta Deploy to Google Play 
 internal track Rollout the new app
 (0.5%~) ࣗ෼Ͱ΍Δ fastlaneͷlaneΛखݩͰ࣮ߦ͢Δ GitHubͰ΍Δ BitriseͰfastlane͕΍Δ Slackܦ༝Ͱ
 Bitrise͕fastlaneͰ΍Δ ࣗ෼Ͱ΍Δ
  12. ©2018 Wantedly, Inc. Release Workflow Checkout release branch Versioning, 


    Create change logs Merge release branch to master Deploy to Crashlytics Beta Deploy to Google Play 
 internal track Rollout the new app
 (0.5%~) ࣗ෼Ͱ΍Δ fastlaneͷlaneΛखݩͰ࣮ߦ͢Δ GitHubͰ΍Δ BitriseͰfastlane͕΍Δ Slackܦ༝Ͱ
 Bitrise͕fastlaneͰ΍Δ ࣗ෼Ͱ΍Δ
  13. ©2018 Wantedly, Inc. Release Workflow Checkout release branch Versioning, 


    Create change logs Merge release branch to master Deploy to Crashlytics Beta Deploy to Google Play 
 internal track Rollout the new app
 (0.5%~) ࣗ෼Ͱ΍Δ fastlaneͷlaneΛखݩͰ࣮ߦ͢Δ GitHubͰ΍Δ BitriseͰfastlane͕΍Δ Slackܦ༝Ͱ
 Bitrise͕fastlaneͰ΍Δ ࣗ෼Ͱ΍Δ ͜ͷϏϧυͰ໿෼ɺ଴ͬͯΒΕΔ͚Ͳ଎͍ͨ͘͠
  14. ©2018 Wantedly, Inc. 3FMFBTFGMPX ࠷ۙͷ8BOUFEMZ1FPQMFͷ3FMFBTFqPX

  15. ©2018 Wantedly, Inc. Release Workflow Checkout release branch Versioning, 


    Create change logs Merge release branch to master Deploy to Crashlytics Beta
 Create GitHub Releases 
 and upload apks. Deploy to Google Play 
 internal track Rollout the new app
 (0.5%~) ࣗ෼Ͱ΍Δ fastlaneͷlaneΛखݩͰ࣮ߦ͢Δ GitHubͰ΍Δ BitriseͰfastlane͕΍Δ Slackܦ༝Ͱ
 GitHub Releases͔ΒDLͨ͠apkΛ
 fastlaneͰΞοϓϩʔυ͢Δ ࣗ෼Ͱ΍Δ Ϗϧυ͕ճ͚ͩʹͳΔͷͰ଎͍ɻ໿෼
  16. ©2018 Wantedly, Inc. ͬ͘͟Γ࡞Γํ ϋϚͬͨϙΠϯτɾ5*14

  17. ©2018 Wantedly, Inc. Create and share your own Step https://devcenter.bitrise.io/bitrise-cli/create-your-own-step/

    Page Title Page Subtitle
  18. ©2018 Wantedly, Inc. 1. Install and setup bitrise CLI •

    brew install bitrise • bitrise setup • bitrise plugin update step ͬ͘͟Γ࡞Γํ ϋϚͬͨϙΠϯτɾTIPS
  19. ©2018 Wantedly, Inc. 2. Create step template • bitrise :step

    create • ର࿩ࣜͷscaffoldίϚϯυ • Author name • Step ID • Summary • Description • Category of step • Language(bash or golang) • Host on GitHub? ͬ͘͟Γ࡞Γํ ϋϚͬͨϙΠϯτɾTIPS bitrise-step-my-step !"" .bitrise.secrets.yml !"" .git !"" .gitignore !"" LICENSE !"" README.md !"" bitrise.yml !"" main.go #"" step.yml
  20. ©2018 Wantedly, Inc. 2. Create step template • bitrise :step

    create • ର࿩ࣜͷscaffoldίϚϯυ • Author name • Step ID • Summary • Description • Category of step • Language(bash or golang) • Host on GitHub? ͬ͘͟Γ࡞Γํ ϋϚͬͨϙΠϯτɾTIPS bitrise-step-my-step !"" .bitrise.secrets.yml !"" .git !"" .gitignore !"" LICENSE !"" README.md !"" bitrise.yml !"" main.go #"" step.yml
  21. ©2018 Wantedly, Inc. 3. Define input/output • step.ymlͰinputͱoutputΛఆٛ͢Δ • ͜͜Ͱఆٛͨ͠΋ͷ͕ɺBitriseͷstepͷೖྗϑΥʔϜʹͳΔ

    ͬ͘͟Γ࡞Γํ ϋϚͬͨϙΠϯτɾTIPS
  22. ©2018 Wantedly, Inc. 4. Implement Step • ࠓճ͸GoΛ࢖͏͜ͱʹͨ͠ • bitrise-tools/go-steputils͕͋ΔͱศརʹͳΔ

    • inputΛparseͨ͠ΓɺloggingͩͬͨΓ • Dependency manager͸golang/dep • ஫ҙ఺ • vendorσΟϨΫτϦ͸ϦϙδτϦʹؚΊͳ͍ͱ࣮ߦͰ͖ͳ͘ͳΔ • main.goʹεςοϓͷ࣮૷Λॻ͍͍ͯ͘ • ໎ͬͨͱ͖͸bitriseެࣜͷStepͷϦϙδτϦΛݟΔͱྑ͍ ͬ͘͟Γ࡞Γํ ϋϚͬͨϙΠϯτɾTIPS
  23. ©2018 Wantedly, Inc. 5. Test • bitrise run test •

    ͟ʔͬͱϏϧυͯ͠εςοϓͷ࣮ߦΛςετͯ͘͠ΕΔ • input͕ඞཁͳ৔߹͸.bitrise.secrets.ymlʹ
 ༧Ίೖྗ͓ͯ͘͠ͱɺbitrise.ymlͰΞΫηεՄೳ ͬ͘͟Γ࡞Γํ ϋϚͬͨϙΠϯτɾTIPS
  24. ©2018 Wantedly, Inc. 5. Release • ެࣜυΩϡϝϯτͩͱͪΐͬͱ෼͔ΓͮΒ͔ͬͨ • bitrise-io/bitrise-steplibΛfork •

    bitrise run audit-this-step • bitrise run share-this-step • bitrise-io/bitrise-steplibʹ޲͚ͯPull Request͕࡞ΒΕΔ • ͜͜ͰReviewΛ௨ΔͱϦϦʔε׬ྃ • ͍͍ͩͨ൒೔ʙ1೔ͰϦϦʔεͰ͖Δ • 2ͭίϚϯυΛୟ͘ඞཁ͕͋ΔͷͰɺscriptʹ͓ͯ͘͠ͱศར ͬ͘͟Γ࡞Γํ ϋϚͬͨϙΠϯτɾTIPS
  25. ©2018 Wantedly, Inc. • Step Development Guideline • https://github.com/bitrise-io/bitrise/blob/master/_docs/step- development-guideline.md

    • bitrise-steplib/steps-github-release • https://github.com/bitrise-steplib/steps-github-release • ಡΉͷʹͪΐ͏Ͳ͍͍Step • How to create and share your own Bitrise step • https://medium.com/@bitrise/how-to-create-and-share-your-own- bitrise-step-34c33dd8ec44 • ެࣜMedium ࢀߟʹͳΓͦ͏ͳURL