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

いつもの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

Yuki Fujisaki

February 07, 2020
Tweet

More Decks by Yuki Fujisaki

Other Decks in Programming

Transcript

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  10. DeployGate ʹ͓͚Δ౷ܭ
    • େ͖Ίͷاۀ: 1ΞϓϦʹ͖ͭ ݄ʹ਺ඦճ ͷΠϯετʔϧ
    • ϐʔΫ࣌͸݄5,000ճ௒έʔε΋
    • ελʔτΞοϓͰ΋݄ʹ200ճ͙Β͍͸ී௨
    • ͪͳΈʹฏۉ21Ͱதԝ஋͸4 (ແྉϢʔβʔؚΉ)

    View full-size slide

  11. ྫ: ҙਤͤͣؒҧͬͨόʔδϣϯΛςετͯ͠͠·͍ɺ
    ख໭Γɺ࠶ݕূ
    • Τϥʔ཰1%ͩͱͯ͠΋݄ʹ਺ճʙ਺ेճ͸ϛεΔ
    • େن໛ʹͳΔ΄ͲɺϦϦʔε௚લʹͳΔ΄ͲɺϏϧυ͕૿͑ɺ
    Τϥʔ཰΋૿͑Δߏ଄

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  15. DeployGateͷ৔߹

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  18. ໨ࢦ͢ͱ͜Ζ

    View full-size slide

  19. ϒϥϯν͝ͱͷ࠷৽൛Λ
    खݩͰࠓ͙͢μ΢ϯϩʔ
    υ

    ୺຤ଆͰ೚ҙͷϒϥϯνΛબ୒ͯ͠
    ΠϯετʔϧͰ͖Δ

    View full-size slide

  20. Slack͔ΒϏϧυͷμ΢ϯϩʔυ΁ભҠ

    DownloadϘλϯͰϒϥϯν͝ͱͷURLΛ։͚Δ

    View full-size slide

  21. ೋ࣍ݩόʔίʔυ͔Β
    ͙࣮͢ػΠϯετʔϧ

    ࠷ۙͷiPhone/Android͸ඪ४ͷΧϝϥ
    ͰಡΊΔ(௥ՃΞϓϦෆཁ)

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  30. 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

    View full-size slide

  31. Send a Slack message εςοϓ (1/2)
    • ·ͣ͸ Slack ଆͰ Webhook URL Λऔಘ
    • Custom Integrations → Incoming WebHooks Ͱ௥Ճ
    • URL Λ Slack Webhook URL ʹઃఆ

    View full-size slide

  32. Send a Slack message εςοϓ (2/2)
    • A list of buttons attached to the message as link buttons ʹ
    Download|${DEPLOYGATE_DISTRIBUTION_URL} Λ௥Ճ

    View full-size slide

  33. ͓΋ΉΖʹBuildΛ࣮ߦ͢Δͱ

    View full-size slide

  34. ͓͢͢Ίઃఆ

    View full-size slide

  35. ϙΠϯτ
    • Revision, Version Code, Version Name, Icon΋ೖΕͱ͘
    • ϛε͕ݮΔ
    • QRίʔυ΋Slack্ʹग़ͯ͠͠·͏
    • खؒΛݮΒ͢

    View full-size slide

  36. νʔτγʔτ
    จࣈࡉ͔͍ͷͰPDFμ΢ϯϩʔυͯ͠ίϐϖ͍ͯͩ͘͠͞

    View full-size slide

  37. 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

    View full-size slide

  38. 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

    View full-size slide

  39. 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}

    View full-size slide

  40. 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}

    View full-size slide

  41. ޮՌ
    • ॳճΠϯετʔϧ
    • ೋ࣍ݩόʔίʔυ →࣮֬ʹର৅Λ։͚Δ
    • ߋ৽ͷΠϯετʔϧ
    • ඞཁͳϒϥϯνͷΈ௨஌Λड͚औΔ →ߋ৽ର৅Λؒҧ͑ͳ͍

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  44. ࡞Δਓͱ࢖͏ਓΛ΋ͬͱۙ͘ʹ

    View full-size slide