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

リリース自動化の導入と効率の良いリリースフローを求めて

 リリース自動化の導入と効率の良いリリースフローを求めて

@DroidKaigi2017 Day.1
by Ryo Sakaguchi (wakwa3125)

Ryo Sakaguchi

March 09, 2017
Tweet

More Decks by Ryo Sakaguchi

Other Decks in Programming

Transcript

  1. About me • Θ͘Θ͘͞Μͱ͔ݺ͹Εͯ ·͢ɻ(ձࣾͰͷ෍ڭʹ͸ࣦ ഊͨ͠) • Wantedly! ͱ͍͏ձࣾͰ Wantedly

    Peopleͷ։ൃΛ ͍ͯ͠·͢ɻ • ݩ͓ͶͩΜҎ্ͳՈ۩԰͞ ΜͰൢചһΛ͍ͯ͠·͠ ͨɻ
  2. Agenda • ࣗಈԽͷงғؾ • ໨త΍ϞνϕʔγϣϯɺͰ͖Δ͜ͱɺϝϦοτͳͲ • ϦϦʔεࣗಈԽʹؔ࿈͢Δπʔϧͷ঺հ • AndroidΞϓϦͷϦϦʔεͷࣗಈԽʹ໾ʹཱͭπʔϧ܈Λ঺հ͠·͢ɻ •

    Ͳ͏΍ͬͯ΍Δͷ͔ʁʢಋೖ४උʣ • ͍͔ͭ͘ͷϓϩδΣΫτΛྫʹɺࣗಈԽͨ͠ϦϦʔεϑϩʔΛಋೖ͢Δ͜ͱΛߟ͑ͯ Έ·͢ɻ • Ͳ͏΍ͬͯ΍Δͷ͔ʁʢಋೖʣ • ࣮ࡍʹಋೖ͢Δࡍʹඞཁͳ࡞ۀΛνΣοΫ͍͖ͯ͠·͢ɻ • ࣦഊ͕ͪ͠ͳέʔεͱ஫ҙ఺ • ·ͱΊతͳ • ࣭ٙԠ౴
  3. Agenda • ࣗಈԽͷงғؾ • ໨త΍ϞνϕʔγϣϯɺͰ͖Δ͜ͱɺϝϦοτͳͲ • ϦϦʔεࣗಈԽʹؔ࿈͢Δπʔϧͷ঺հ • AndroidΞϓϦͷϦϦʔεͷࣗಈԽʹ໾ʹཱͭπʔϧ܈Λ঺հ͠·͢ɻ •

    Ͳ͏΍ͬͯ΍Δͷ͔ʁʢಋೖ४උʣ • ͍͔ͭ͘ͷϓϩδΣΫτΛྫʹɺࣗಈԽͨ͠ϦϦʔεϑϩʔΛಋೖ͢Δ͜ͱΛߟ͑ͯ Έ·͢ɻ • Ͳ͏΍ͬͯ΍Δͷ͔ʁʢಋೖʣ • ࣮ࡍʹಋೖ͢Δࡍʹඞཁͳ࡞ۀΛνΣοΫ͍͖ͯ͠·͢ɻ • ࣦഊ͕ͪ͠ͳέʔεͱ஫ҙ఺ • ·ͱΊతͳ • ࣭ٙԠ౴
  4. ͜Μͳ͜ͱ͕Մೳʹ • Google Play Developer Console΁ͷAPKΞοϓϩʔυ(ෳ ਺APKͷҰׅΞοϓϩʔυ΋OKʂ) • ετΞ৘ใͷߋ৽ •

    Change log • Long description • Short description • ScreenShots • ؂ࢹπʔϧ(Crashlytics΍Firebase Crash Reporting, Bugsnag…) ΁ͷmapping.txtϑΝΠϧͷΞοϓϩʔυ
  5. Agenda • ࣗಈԽͷงғؾ • ໨త΍ϞνϕʔγϣϯɺͰ͖Δ͜ͱɺϝϦοτͳͲ • ϦϦʔεࣗಈԽʹؔ࿈͢Δπʔϧͷ঺հ • AndroidΞϓϦͷϦϦʔεͷࣗಈԽʹ໾ʹཱͭπʔϧ܈Λ঺հ͠·͢ɻ •

    Ͳ͏΍ͬͯ΍Δͷ͔ʁʢಋೖ४උʣ • ͍͔ͭ͘ͷϓϩδΣΫτΛྫʹɺࣗಈԽͨ͠ϦϦʔεϑϩʔΛಋೖ͢Δ͜ͱΛߟ͑ͯ Έ·͢ɻ • Ͳ͏΍ͬͯ΍Δͷ͔ʁʢಋೖʣ • ࣮ࡍʹಋೖ͢Δࡍʹඞཁͳ࡞ۀΛνΣοΫ͍͖ͯ͠·͢ɻ • ࣦഊ͕ͪ͠ͳέʔεͱ஫ҙ఺ • ·ͱΊతͳ • ࣭ٙԠ౴
  6. CI

  7. CI • Wercker 1. DockerͰίϯςφΛ޷͖ʹ࡞ͬ ͯϏϧυ؀ڥΛ͔ͳΓࣗ༝ʹ૊ ΈཱͯΔ͜ͱ͕Ͱ͖Δ • Dockerfile͕ॻ͚Ε͹޷͖ʹ ࡞ΕΔ

    2. ଞʹ΋͢Ͱʹग़དྷ্͕͍ͬͯΔ ίϯςφΛ࢖͏͜ͱ΋Ͱ͖Δɻ 3. ͸΍͍ 4. αϙʔτ͕ϑϥϯΫͳؾ͕͢ Δɻ 5. ͍͍ͩͨແྉ
  8. CI • Bitrise 1. ͳΜͱͳ͘iOSͷΠϝʔδ͕ڧ͍͔ ΋͠Εͳ͍͚Ͳɺandroidͷαϙʔ τ΋εΰΠ͔ͬ͠Γ͍ͯ͠Δɻ 2. ͍͍ͩͨجຊతʹ͸GUIͰ׬݁Ͱ͖ ΔͷͰɺͪΐͬͱमਖ਼͍ͨ͠ͱ͖

    ͱ͔ศར 3. WEBͷίϯιʔϧ͔ΒϏϧυΛε έδϡʔϧͯ͠ୟ͘͜ͱ΋Ͱ͖Δɻ 4. ͔ͬ͠Γ࢖͏ͳΒ༗ྉ͚ͩͲɺ੍ ݶ෇͖ͷແྉϓϥϯ΋͋Δɻ 5. ໘౗ͳॺ໊ϑΝΠϧͷ؅ཧΛखॿ ͚ͯ͘͠ΕΔ
  9. Agenda • ࣗಈԽͷงғؾ • ໨త΍ϞνϕʔγϣϯɺͰ͖Δ͜ͱɺϝϦοτͳͲ • ϦϦʔεࣗಈԽʹؔ࿈͢Δπʔϧͷ঺հ • AndroidΞϓϦͷϦϦʔεͷࣗಈԽʹ໾ʹཱͭπʔϧ܈Λ঺հ͠·͢ɻ •

    Ͳ͏΍ͬͯ΍Δͷ͔ʁʢಋೖ४උʣ • ͍͔ͭ͘ͷϓϩδΣΫτΛྫʹɺࣗಈԽͨ͠ϦϦʔεϑϩʔΛಋೖ͢Δ͜ͱΛߟ͑ͯ Έ·͢ɻ • Ͳ͏΍ͬͯ΍Δͷ͔ʁʢಋೖʣ • ࣮ࡍʹಋೖ͢Δࡍʹඞཁͳ࡞ۀΛνΣοΫ͍͖ͯ͠·͢ɻ • ࣦഊ͕ͪ͠ͳέʔεͱ஫ҙ఺ • ·ͱΊతͳ • ࣭ٙԠ౴
  10. ຊ౰ʹඞཁͰ͔͢ʁ • ͳͥࣗಈԽ͢Δͷ͔ • ͜Εʹ͍ͭͯಥ͖٧Ίͯߟ͍͑ͯ͘ͱ࣮ࡍ͸͠ͳͯ͘΋͍͍έʔ ε͸ଘࡏ͠·͢ɻ • ԿΛͲ͏ࣗಈԽ͢Δ͔͕ࣗͣͱݟ͖͑ͯ·͢ɻ • ͦΕ͕Ͱ͖ͨΒಋೖ४උ͕ऴͬͨΈ͍ͨͳ΋ΜͰ͢ɻ

    • ࣗಈԽ͢ΔϝϦοτ͕͋Δͳɺͱײͨ͡Β࣮ࡍʹ࡞ۀʹͱΓ͔͔ Γ·͠ΐ͏ɻ • ϝϦοτ͕ײ͡ΒΕͨΒɺʮfoobar͔ͩΒࣗಈԽ͍ͨ͠ɻ͔ͩ Βগ࣌ؒ͘͠Εʯతͳ͓࿩ΛνʔϜͰ͢Δͱྑ͍ͱࢥ͍·͢ɻ • ݸਓͳΒؾʹͤͣ΍ͬͯ͠·͍·͠ΐ͏ɻ
  11. APK Splitʁ splits { abi { enable true reset() include

    'x86', 'armeabi', 'armeabi-v7a' universalApk false // trueʹ͢Δͱ෼ղͨ͠APKͷଞʹ // ࠓ·ͰϏϧυ͍ͯͨ͠APK΋ग़ྗ͞Ε·͢ɻ // fablic΍DeployGateʹΞοϓϩʔυ͢ΔࡍʹޮՌత } }
  12. Agenda • ࣗಈԽͷงғؾ • ໨త΍ϞνϕʔγϣϯɺͰ͖Δ͜ͱɺϝϦοτͳͲ • ϦϦʔεࣗಈԽʹؔ࿈͢Δπʔϧͷ঺հ • AndroidΞϓϦͷϦϦʔεͷࣗಈԽʹ໾ʹཱͭπʔϧ܈Λ঺հ͠·͢ɻ •

    Ͳ͏΍ͬͯ΍Δͷ͔ʁʢಋೖ४උʣ • ͍͔ͭ͘ͷϓϩδΣΫτΛྫʹɺࣗಈԽͨ͠ϦϦʔεϑϩʔΛಋೖ͢Δ͜ͱΛߟ͑ͯ Έ·͢ɻ • Ͳ͏΍ͬͯ΍Δͷ͔ʁʢಋೖʣ • ࣮ࡍʹಋೖ͢Δࡍʹඞཁͳ࡞ۀΛνΣοΫ͍͖ͯ͠·͢ɻ • ࣦഊ͕ͪ͠ͳέʔεͱ஫ҙ఺ • ·ͱΊతͳ • ࣭ٙԠ౴
  13. ࠓճͷཁ݅(͋͘·Ͱ΋૝ఆͰ͢) • ঢ়گ • ͋ͳͨ͸5ਓͰߏ੒͞Εͨ։ൃνʔϜͷAndroidΤϯδχΞͰ ͢ɻ • ΞϓϦ͸ࠃࡍల։͓ͯ͠Γɺ຋༁΋֎෦ʹґཔ͍ͯͨ͠Γ͠· ͢ɻ •

    ͜ͷ1ϲ݄ɺαʔϏεάϩʔεͷͨΊʹɺ1िؒʹ1ճͷϦϦʔε αΠΫϧΛճ͍ͯ͘͠ࣄʹͳΓ·ͨ͠ɻ • νʔϜʹ͸ϏδωεαΠυͷਓ΋ډ·͢ɻ·ͨɺCSνʔϜ͔Β ͸ϦϦʔε͕͞ΕͨΒ͍ͪૣ͘ڭ͑ͯ΄͍͠ͱݴΘΕ͍ͯ·͢ɻ • ΞϓϦ಺ͷDBʹ͸RealmΛ࢖༻͍ͯ͠·͢ɻ
  14. ࠓճ͸αΫοͱͰ͖ΔࣗಈԽͰߟ͍͑ͨͱࢥ͍·͢ɻ 1. GooglePlay Developer Console΁ΞΫηε͠ ·͢ɻ → ͢΂ͯϩʔΧϧͰ४උ&׬݁͠·͠ΐ͏ by fastlane

    2. APKΛΞοϓϩʔυ͠(x5)ɺ֤ݴޠ͝ͱʹΞο ϓσʔτจΛίϐϖ͍͖ͯ͠·͢(x10)ɻ → ϓϩάϥϜʹ೚ͤ·͠ΐ͏ by fastlane && CI
  15. ࠓճ͸αΫοͱͰ͖ΔࣗಈԽͰߟ͍͑ͨͱࢥ͍·͢ɻ 1. GooglePlay Developer Console΁ΞΫηε͠·͢ɻ → ͢΂ͯϩʔΧϧͰ४උ&׬݁͠·͠ΐ͏ by fastlane 2.

    APKΛΞοϓϩʔυ͠(x5)ɺ֤ݴޠ͝ͱʹΞοϓσʔτจΛ ίϐϖ͍͖ͯ͠·͢(x10)ɻ → ϓϩάϥϜʹ೚ͤ·͠ΐ͏ by fastlane && CI 3. APKΛΞοϓϩʔυޙɺCSνʔϜͱ։ൃνʔϜʹʮΞοϓ ϩʔυ͕׬ྃ͠·ͨ͠ʯͱप஌͠·͢ɻ → SlackͰࣗಈతʹ௨஌͢Δ࢓૊ΈΛ࡞Γ·͠ΐ͏ by Slack & CI
  16. ࠓճ͸αΫοͱͰ͖ΔࣗಈԽͰߟ͍͑ͨͱࢥ͍·͢ɻ 1. GooglePlay Developer Console΁ΞΫηε͠·͢ɻ → ͢΂ͯϩʔΧϧͰ४උ&׬݁͠·͠ΐ͏ by fastlane 2.

    APKΛΞοϓϩʔυ͠(x5)ɺ֤ݴޠ͝ͱʹΞοϓσʔτจΛίϐϖ͍͖ͯ͠· ͢(x10)ɻ → ϓϩάϥϜʹ೚ͤ·͠ΐ͏ by fastlane && CI 3. APKΛΞοϓϩʔυޙɺCSνʔϜͱ։ൃνʔϜʹʮΞοϓϩʔυ͕׬ྃ͠· ͨ͠ʯͱप஌͠·͢ɻ → SlackͰࣗಈతʹ௨஌͢Δ࢓૊ΈΛ࡞Γ·͠ΐ͏ by Slack & CI 4. ετΞͷߋ৽ΛPlayConsoleΞϓϦͷ௨஌Ͱ֬ೝͰ͖ͨͷͰɺCSνʔϜʹ΋ ͏Ұ౓࿈ܞ͠·͢ɻ → ͪ͜Β΋SlackͰࣗಈతʹ௨஌͢Δ࢓૊ΈΛ࡞Γ·͠ΐ͏ by tonkotsu
  17. Step.1(3/3) ͜Μͳײ͡ͰΞοϓσʔτจ͕͸͍ͬͨσΟϨΫτϦ͕ϓϩδΣ ΫτϑΥϧμ಺ʹੜ੒͞Ε·͢ɻ ΞοϓσʔτΛ഑৴͢Δࡍ͸ςΩετϑΝΠϧʹόʔδϣϯίʔ υͷ໊લΛ͚ͭͯɺΞοϓϩʔυ͢Δ͜ͱͰετΞʹߋ৽͕͔͔ Γ·͢ɻ metadata └── android ├──

    en-US │ └── changelogs │ ├── 100000.txt // όʔδϣϯίʔυ͕ϑΝΠϧ໊ʹͳΔ │ └── 100100.txt └── ja-JP └── changelogs └── 100100.txt fastlaneͷ४උ͸Ҏ্Ͱ͢ɻ
  18. Step.2(1/2) • CI͕masterϓογϡʹ൓Ԡͯ͠ɺϦϦʔεϏϧ υΛ࡞੒͠ɺfastlaneΛୟ͘༻ʹઃఆ͠·͠ΐ ͏ɻ release: steps: - script: name:

    Upload to GooglePlay. code: | ls -la $WERCKER_REPORT_ARTIFACTS_DIR ./script/deploy/deploy2googleplay.sh
  19. Step.2(2/2) • /deploy2googleplay.shͷத਎ fastlane supply run -p com.wakwak.awsomeglobalapp \ -j

    ./app/signingConfigs/json_key.json \ -u \ "./app/build/outputs/apk/app-production-arm64-v8a-release.apk",\ "./app/build/outputs/apk/app-production-armeabi-release.apk",\ "./app/build/outputs/apk/app-production-armeabi-v7a-release.apk",\ "./app/build/outputs/apk/app-production-mips-release.apk",\ "./app/build/outputs/apk/app-production-x86-release.apk",\ "./app/build/outputs/apk/app-production-x86_64-release.apk" \ --verbose --skip_upload_images --skip_upload_screenshots ͜͜·Ͱ΍Ε͹ ͱΓ͋͑ͣϏϧυˠϦϦʔε͸׬੒͠·͢
  20. Step.3(2/2) • શମͰ͸͜Μͳײ͡ʹͳΔ͔ͱࢥ͍·͢ɻ release: steps: - script: name: Upload to

    GooglePlay. code: | ls -la $WERCKER_REPORT_ARTIFACTS_DIR ./script/deploy/deploy2googleplay.sh after-steps: - slack-notifier: url: $SLACK_URL_RELEASE channel: release username: wercker
  21. Step.4 (1/1) • ετΞͷߋ৽Λ௨஌͠·͠ΐ͏ tonkotsuΛ࢖͍·͢ ઃఆํ๏͸ϦϙδτϦʹৄ͘͠ॻ͍ͯ͋Γ·͢ɻ > go run tonkotsu.go

    config.go -c config.toml • ͜ΕͰɺετΞ͕ߋ৽͞Εͨ࣌ʹSlackͷ௨஌ ΛૹΔ͜ͱ͕Ͱ͖ΔͷͰɺىಈ͚͓͚ͩͯ͠͹ ଞͷ࡞ۀʹूதͰ͖·͢
  22. Agenda • ࣗಈԽͷงғؾ • ໨త΍ϞνϕʔγϣϯɺͰ͖Δ͜ͱɺϝϦοτͳͲ • ϦϦʔεࣗಈԽʹؔ࿈͢Δπʔϧͷ঺հ • AndroidΞϓϦͷϦϦʔεͷࣗಈԽʹ໾ʹཱͭπʔϧ܈Λ঺հ͠·͢ɻ •

    Ͳ͏΍ͬͯ΍Δͷ͔ʁʢಋೖ४උʣ • ͍͔ͭ͘ͷϓϩδΣΫτΛྫʹɺࣗಈԽͨ͠ϦϦʔεϑϩʔΛಋೖ͢Δ͜ͱΛߟ͑ͯ Έ·͢ɻ • Ͳ͏΍ͬͯ΍Δͷ͔ʁʢಋೖʣ • ࣮ࡍʹಋೖ͢Δࡍʹඞཁͳ࡞ۀΛνΣοΫ͍͖ͯ͠·͢ɻ • ࣦഊ͕ͪ͠ͳέʔεͱ஫ҙ఺ • ·ͱΊతͳ • ࣭ٙԠ౴
  23. Agenda • ࣗಈԽͷงғؾ • ໨త΍ϞνϕʔγϣϯɺͰ͖Δ͜ͱɺϝϦοτͳͲ • ϦϦʔεࣗಈԽʹؔ࿈͢Δπʔϧͷ঺հ • AndroidΞϓϦͷϦϦʔεͷࣗಈԽʹ໾ʹཱͭπʔϧ܈Λ঺հ͠·͢ɻ •

    Ͳ͏΍ͬͯ΍Δͷ͔ʁʢಋೖ४උʣ • ͍͔ͭ͘ͷϓϩδΣΫτΛྫʹɺࣗಈԽͨ͠ϦϦʔεϑϩʔΛಋೖ͢Δ͜ͱΛߟ͑ͯ Έ·͢ɻ • Ͳ͏΍ͬͯ΍Δͷ͔ʁʢಋೖʣ • ࣮ࡍʹಋೖ͢Δࡍʹඞཁͳ࡞ۀΛνΣοΫ͍͖ͯ͠·͢ɻ • ࣦഊ͕ͪ͠ͳέʔεͱ஫ҙ఺ • ·ͱΊతͳ • ࣭ٙԠ౴