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

Bitrise Stepの作り方

Bitrise Stepの作り方

Ryo Sakaguchi

August 16, 2018
Tweet

More Decks by Ryo Sakaguchi

Other Decks in Programming

Transcript

  1. ©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Ͱ΍Δ ࣗ෼Ͱ΍Δ
  2. ©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Ͱ΍Δ ࣗ෼Ͱ΍Δ
  3. ©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Ͱ΍Δ ࣗ෼Ͱ΍Δ
  4. ©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Ͱ΍Δ ࣗ෼Ͱ΍Δ
  5. ©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Ͱ΍Δ ࣗ෼Ͱ΍Δ
  6. ©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Ͱ΍Δ ࣗ෼Ͱ΍Δ
  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
 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ͰΞοϓϩʔυ͢Δ ࣗ෼Ͱ΍Δ Ϗϧυ͕ճ͚ͩʹͳΔͷͰ଎͍ɻ໿෼
  9. ©2018 Wantedly, Inc. 1. Install and setup bitrise CLI •

    brew install bitrise • bitrise setup • bitrise plugin update step ͬ͘͟Γ࡞Γํ ϋϚͬͨϙΠϯτɾTIPS
  10. ©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
  11. ©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
  12. ©2018 Wantedly, Inc. 4. Implement Step • ࠓճ͸GoΛ࢖͏͜ͱʹͨ͠ • bitrise-tools/go-steputils͕͋ΔͱศརʹͳΔ

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

    ͟ʔͬͱϏϧυͯ͠εςοϓͷ࣮ߦΛςετͯ͘͠ΕΔ • input͕ඞཁͳ৔߹͸.bitrise.secrets.ymlʹ
 ༧Ίೖྗ͓ͯ͘͠ͱɺbitrise.ymlͰΞΫηεՄೳ ͬ͘͟Γ࡞Γํ ϋϚͬͨϙΠϯτɾTIPS
  14. ©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
  15. ©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