いつものQAをもっと楽にするDeployGateの使い方 / Tips to make day to day app QA easier with DeployGate

いつものQAをもっと楽にするDeployGateの使い方 / Tips to make day to day app QA easier with DeployGate

0ab502179956dab407e6e146bce304f9?s=128

Yuki Fujisaki

February 07, 2020
Tweet

Transcript

  1. ͍ͭ΋ͷQAΛ΋ͬͱָʹ͢Δ DeployGateͷ࢖͍ํ Yuki Fujisaki, DeployGate Inc. Ϋϥ΢υϞόΠϧϏϧυ/ςετ Meetup, Feb. 7,

    2020
  2. ͜ͷ10෼ͷΰʔϧ • ࣮ػݕূͷϫʔΫϑϩʔΛվળ͢ΔώϯτΛڞ༗ • ΞϓϦͷCI/CD͢Δͱ͖ɺ഑৴ͷ࢓ํΛͪΐͬͱ޻෉͢Δͱ ࣮ػςετ͢Δਓ͕ΊͬͪΌ޾ͤʹͳΕΔ • Bitrise + DeployGate

    Ͱศརͳνʔτγʔτ
  3. ࣭໰ ΞϓϦ։ൃʹ͓͍ͯɺ ࣗಈϏϧυͱ഑෍αʔϏεΛ࢖͍ͬͯΔ

  4. ࣭໰ ΞϓϦ։ൃʹ͓͍ͯɺ ࣗಈϏϧυͱ഑෍αʔϏεΛ࢖͓ͬͯΓɺ ςελʔ͕ର৅Λؒҧ͏͜ͱͳ͘ ͙͢ʹݕূΛ։࢝Ͱ͖͍ͯΔ

  5. ςετର৅ͷϏϧυɺ Ͳ͏ड͚౉ͯ͠͠Δʁ

  6. ςετର৅ͷϏϧυɺͲ͏ड͚౉ͯ͠͠Δʁ Կ͔ࣾώΞϦϯάͯ͠Έͨ • QA༻ͷϏϧυΛ࡞͍ͬͯΔέʔε͕ଟ͍ • Slack΍νέοτͰϏϧυͷ൪߸Λ఻͍͑ͯΔ • ࣌ʑCIͷϏϧυ݁ՌͷURL͚ͩ఻͑ΒΕͯΔʢԿނ…ʣ

  7. ड͚औΔଆͷ࡞ۀ Πϯετʔϧର৅ͷಛఆ • ൪߸Λ΋ͱʹɺର৅ͷϏϧυΛҰཡ͔ Β୳͢ • େਓ਺ͰCI࢖͏ͱ༷ʑͳछྨͷϏϧυ ͕ࠞ͟Δ • ։ൃϒϥϯνɺεςʔδϯά޲͖ɺ

    ϦϦʔε༻, etc.
  8. ʮ͜ͷόʔδϣϯͰςετ͓ئ͍͠·͢ʯ • ԟʑʹ࣮ͯ͠ػͰ୳͠ग़͢ͷ͸໘౗ • ݕূ༻୺຤ʹ͸Slack΋ϝʔϧΞΧ΢ϯτ΋ೖ͍ͬͯͳ͍

  9. ࠣࡉͳ͜ͱɺͩͱࢥΘΕ͕ͪ • ΞϓϦͷΠϯετʔϧ͸1೔ʹԿ౓΋܁Γฦ͠ߦ͏࡞ۀ • ಛʹϦϦʔε͕ഭΔͱ૿Ճ

  10. DeployGate ʹ͓͚Δ౷ܭ • େ͖Ίͷاۀ: 1ΞϓϦʹ͖ͭ ݄ʹ਺ඦճ ͷΠϯετʔϧ • ϐʔΫ࣌͸݄5,000ճ௒έʔε΋ •

    ελʔτΞοϓͰ΋݄ʹ200ճ͙Β͍͸ී௨ • ͪͳΈʹฏۉ21Ͱதԝ஋͸4 (ແྉϢʔβʔؚΉ)
  11. ྫ: ҙਤͤͣؒҧͬͨόʔδϣϯΛςετͯ͠͠·͍ɺ ख໭Γɺ࠶ݕূ • Τϥʔ཰1%ͩͱͯ͠΋݄ʹ਺ճʙ਺ेճ͸ϛεΔ • େن໛ʹͳΔ΄ͲɺϦϦʔε௚લʹͳΔ΄ͲɺϏϧυ͕૿͑ɺ Τϥʔ཰΋૿͑Δߏ଄

  12. ࣮ػݕূͷϫʔΫϑϩʔ

  13. ഑৴ج൫Λ੔͑Δͷ͸։ൃऀ͚ͩͲ • ࣮ࡍʹҰ൪࢖͍ͬͯΔͷ͸ςελʔ • खؒʹͳΔ͜ͱ͕͋ͬͯ΋ׂͱ૑ҙ޻෉ͰؤுͬͪΌ͏܏޲ • ՝୊͕͋ͬͯ΋ݟ͑ͮΒ͘ɺվળ͕ޙճ͠ʹͳΓ͕ͪ

  14. ཁٻͷఆٛ ςετର৅ͷϏϧυΛؒҧΘͣɺ؆୯࣮֬ʹ ΠϯετʔϧՄೳͳ࢓૊Έ͕ཉ͍͠

  15. DeployGateͷ৔߹

  16. ഑෍ϖʔδػೳ • ʮݻఆͷURLͰ೚ҙʹࢦఆͨ͠όʔδϣϯΛ഑৴͢Δػೳʯ • URL͸มߋͤͣʹର৅ϏϧυΛม͑Δ͜ͱ͕Մೳ • ϙΠϯτ: CIͱ૊Έ߹Θͤͯࣗಈతʹ࡞੒ɾߋ৽Ͱ͖Δ

  17. None
  18. ఏҊख๏ • Gitϒϥϯν͝ͱʹࣗಈతʹ഑෍ϖʔδΛ࡞Δ • ϒϥϯν͝ͱͷ࠷৽൛ΛΠϯετʔϧͰ͖ΔURL͕ಘΒΕΔ → https://deploygate.com/distributions/[ϋογϡ஋] • ଞͷϒϥϯνͷߋ৽ʹӨڹ͞Εͳ͍

  19. ໨ࢦ͢ͱ͜Ζ

  20. ϒϥϯν͝ͱͷ࠷৽൛Λ खݩͰࠓ͙͢μ΢ϯϩʔ υ ✅ ୺຤ଆͰ೚ҙͷϒϥϯνΛબ୒ͯ͠ ΠϯετʔϧͰ͖Δ

  21. Slack͔ΒϏϧυͷμ΢ϯϩʔυ΁ભҠ ✅ DownloadϘλϯͰϒϥϯν͝ͱͷURLΛ։͚Δ

  22. ೋ࣍ݩόʔίʔυ͔Β ͙࣮͢ػΠϯετʔϧ ✅ ࠷ۙͷiPhone/Android͸ඪ४ͷΧϝϥ ͰಡΊΔ(௥ՃΞϓϦෆཁ)

  23. ࢖͏΋ͷ DeployGate Upload API ͷ distribution_name Φϓγϣϯ

  24. Bitriseͷ৔߹ DeployGate Upload εςοϓΛ࢖͏

  25. Bitriseͷ৔߹ DeployGate: Distribution Name ʹ $BITRISE_GIT_BRANCH Λઃఆ

  26. curlͷ৔߹ Ҿ਺Λ௥Ճ -F distribution_name="$(git symbolic-ref --short HEAD)" • gitͷݱࡏͷϒϥϯν໊Λ౉͢

  27. ͜Ε͚ͩ • ϒϥϯν͝ͱͷ഑෍ϖʔδ࡞੒ • DeployGateΞϓϦ͔Βબ΂Δঢ়ଶ • ͦΕͧΕͷϒϥϯνͷ࠷৽൛Λμ΢ ϯϩʔυͰ͖Δ

  28. ීஈݟͯΔ৔ॴʹಋઢΛஔ͘

  29. URLΛSlackʹ௨஌ • Upload API͔ΒฦΔJSON͔Β഑෍ϖʔδͷURLΛऔಘ • SlackʹϦϯΫΛૹΔ

  30. Bitrise Λྫʹ঺հ Script ͱ Send a Slack Message εςοϓΛ௥Ճ

  31. Script εςοϓ ݁ՌͷJSON͔Β഑෍ϖʔδURLΛ؀ڥม਺ʹηοτ ruby -rjson -e \ 'print JSON.parse(ENV["DEPLOYGATE_UPLOAD_APP_STEP_RESULT_JSON"])["results"]["distribution"]["url"]' |

    \ envman add --key DEPLOYGATE_DISTRIBUTION_URL
  32. Send a Slack message εςοϓ (1/2) • ·ͣ͸ Slack ଆͰ

    Webhook URL Λऔಘ • Custom Integrations → Incoming WebHooks Ͱ௥Ճ • URL Λ Slack Webhook URL ʹઃఆ
  33. Send a Slack message εςοϓ (2/2) • A list of

    buttons attached to the message as link buttons ʹ Download|${DEPLOYGATE_DISTRIBUTION_URL} Λ௥Ճ
  34. ͓΋ΉΖʹBuildΛ࣮ߦ͢Δͱ

  35. ͓͢͢Ίઃఆ

  36. None
  37. ϙΠϯτ • Revision, Version Code, Version Name, Icon΋ೖΕͱ͘ • ϛε͕ݮΔ

    • QRίʔυ΋Slack্ʹग़ͯ͠͠·͏ • खؒΛݮΒ͢
  38. νʔτγʔτ จࣈࡉ͔͍ͷͰPDFμ΢ϯϩʔυͯ͠ίϐϖ͍ͯͩ͘͠͞

  39. Script εςοϓ #!/usr/bin/env bash set -ex json_parse() { ruby -rjson

    -e "print JSON.parse(ENV['DEPLOYGATE_UPLOAD_APP_STEP_RESULT_JSON'])$1" } json_to_env() { json_parse $1 | envman add --key $2 } json_to_env '["results"]["distribution"]["url"]' DEPLOYGATE_DISTRIBUTION_URL json_to_env '["results"]["revision"]' DEPLOYGATE_REVISION json_to_env '["results"]["icon"]' DEPLOYGATE_APP_ICON json_to_env '["results"]["version_code"]' DEPLOYGATE_VERSION_CODE json_to_env '["results"]["version_name"]' DEPLOYGATE_VERSION_NAME echo -n "https://deploygate.com/qr?size=200&data=$(json_parse '["results"]["distribution"]["url"]')" \ | envman add --key DEPLOYGATE_DISTRIBUTION_URL_QR
  40. Send a Slack message εςοϓ 1/3 • URL to an

    image to use as the icon for the message → $DEPLOYGATE_APP_ICON • the bot's username for the message → $BITRISE_APP_TITLE • A URL to an image file that will be displayed inside the attachment → $DEPLOYGATE_DISTRIBUTION_URL_QR
  41. Send a Slack message εςοϓ 2/3 • A list of

    fields to be displayed in a table inside the attachmentInsert variable ↓ Branch|${BITRISE_GIT_BRANCH} Version Name|${DEPLOYGATE_VERSION_NAME} Version Code|${DEPLOYGATE_VERSION_CODE} DeployGate Revision|#${DEPLOYGATE_REVISION}
  42. Send a Slack message εςοϓ 3/3 • A list of

    buttons attached to the message as link buttons ↓ View Build|${BITRISE_BUILD_URL} Download|${DEPLOYGATE_DISTRIBUTION_URL}
  43. ޮՌ • ॳճΠϯετʔϧ • ೋ࣍ݩόʔίʔυ →࣮֬ʹର৅Λ։͚Δ • ߋ৽ͷΠϯετʔϧ • ඞཁͳϒϥϯνͷΈ௨஌Λड͚औΔ

    →ߋ৽ର৅Λؒҧ͑ͳ͍
  44. ޮՌ • ςετର৅ͷϏϧυΛ୳͢ख͕ؒෆཁʹͳΔ • ؒҧ͑Α͏͕ͳ͘ͳΔ • ϦϦʔεϏϧυ༻ͷϒϥϯνΛ࡞੒͓ͯ͘͠ͱɺ ࠷ޙͷϦϦʔε൛͔ΒͷΞοϓσʔτͷ֬ೝ΋खܰ

  45. ·ͱΊ • ΞϓϦͷCD͸ɺ഑৴Ͱ͖ͨΒऴΘΓ͡Όͳ͍Α • Πϯετʔϧ΍੾Γସ͑ͷखॱ΋࠷దԽ͠Α͏ • ςετର৅Λ໎ΘͣΠϯετʔϧͰ͖Δ؀ڥ͸؆୯ʹ੔͏ • ։ൃதͷϏϧυΛϒϥϯνͰࣗಈ෼ྨͯ͠ΞΫηε͠΍͘͢ •

    DeployGateͷ഑෍ϖʔδศརͳͷͰ࢖ͬͯͶ
  46. ࡞Δਓͱ࢖͏ਓΛ΋ͬͱۙ͘ʹ