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

リクルートマーケティングパートナーズでのDeployGate活用事例

Naoki Ainoya
November 28, 2016

 リクルートマーケティングパートナーズでのDeployGate活用事例

Bakusoku Iterations Tokyo Vol.2 での発表資料です。

Naoki Ainoya

November 28, 2016
Tweet

More Decks by Naoki Ainoya

Other Decks in Programming

Transcript

  1. ϦΫϧʔτϚʔέςΟϯάύʔτφʔζͰͷ

    DeployGate׆༻ࣄྫ
    @naokiainoya

    View full-size slide

  2. ࣗݾ঺հ
    • @naokiainoya
    • ϦΫϧʔτϚʔέςΟϯάύʔτφʔζ

    ϓϩμΫτ։ൃ෦ ։ൃࢧԉάϧʔϓ

    View full-size slide

  3. ։ൃج൫ΤϯδχΞతͳ͜ͱΛ
    ͍ͯ͠·͢
    ։ൃࢧԉ(

    ϓϩμΫτԣஅతͰٕज़ࢧԉΛߦ͏
    ϓϩμΫτ։ൃ෦ͷ୲౰ϓϩμΫτ܈

    View full-size slide

  4. ϓϩμΫτ։ൃΛ

    Ճ଎ͤ͞ΔͨΊͷ։ൃ
    • ΤϯδχΞͷख͕ճΓ͖Εͯͳ͍ͱ͜ΖΛ

    र͍ʹ͍͓͘࢓ࣄͰ͢

    View full-size slide

  5. ۩ମతͳۀ຿
    • ࣾ಺herokuͷߏங(deis on GCP)
    • σʔλղੳج൫ߏங
    • e2eςετ(Appium/Selenium)
    • ݕূ୺຤؀ڥ੔උ(OpenSTFಋೖ)

    View full-size slide

  6. CI؀ڥߏங(CircleCI, DeployGate)
    • ଍ճΓݻΊେࣄ
    https://cdn.meme.am/instances/500x/
    65068604.jpg
    https://cdn.meme.am/instances/500x/
    65068604.jpg
    https://cdn.meme.am/instances/500x/
    65068604.jpg

    View full-size slide

  7. DeployGate
    • (΄΅)શͯͷϓϩμΫτͰ࢖ͬͯ·͢!!

    View full-size slide

  8. Έͳ͞ΜԿਓ͙Β͍Ͱ
    DeployGate࢖ͬͯ·͔͢ʁ
    • 50ਓҎ্ͷਓʁ
    • 100ਓҎ্ͷਓʁʁ
    • 500ਓҎ্ͷਓʁʁʁ

    View full-size slide

  9. ฐࣾͷDeployGateϢʔβ਺ɺ
    ଟ͍
    • ϦΫϧʔτάϧʔϓͱͯ͠
    શࣾతʹར༻

    ฐΧϯύχʔ͚ͩͰ100ਓ
    ௒ɾΞϓϦ਺ेຊ
    • (શମͰ਺͑ΔͱͱΜͰ΋ͳ
    ͍ਓ਺ʹ)

    View full-size slide

  10. εςʔΫϗϧμʔଟ͍؀ڥͰͷ
    ΞϓϦ഑෍…
    • σΟϨΫλʔɾӦۀɾίϯςϯπฤूऀͳͲ
    ؔ܎ऀ͕ଟ͍
    • iOSͷ৔߹uuidొ࿥ͳͲ൥Θ͍͠λεΫ͕ଟ͍
    ͷͰࠔ͍ͬͯͨ

    View full-size slide

  11. EnterpriseϏϧυ+ެ։ϖʔδ
    Ͱര଎഑෍
    • ѹ౗తͳෛ୲ݮ

    View full-size slide

  12. slack࿈ܞͰ͙͢഑෍
    • (iOS)fastlaneͷslack webhookͰ௨஌
    • (android)deploygateͷwebhookͰ௨஌

    View full-size slide

  13. ഑෍ཤྺ΋ݟฦͤΔศར͞
    • ୭͕ԿͷversionΛμ΢ϯϩʔυͨ͠ͷ͔·Ͱ
    Slackʹ௨஌Ͱ͖Δ
    • QAͷͱ͖ಛʹ໾ʹཱͭ

    View full-size slide

  14. μ΢ϯϩʔυͨ͠ΞϓϦ͕ͻͱ໨Ͱ
    Կͷόʔδϣϯ͔Θ͔Βͳ͍໰୊
    • ݱ৔Ͱ֬ೝͷ࣌ɺεϚϗͰΞϓϦΛ։͍ͯ

    όʔδϣϯ৘ใΛݟͳ͍ͱ෼͔Βͳ͍
    • QAͷͱ͖ɺಛʹࠔΔ

    View full-size slide

  15. ։ൃ൛Ͱͷͪΐͬͱͨ͠޻෉
    • ΞΠίϯʹόʔδϣϯ෇༩
    • Πϯετʔϧ͞Εͨόʔδϣϯ͕

    Ұ໨ྎવʹ

    View full-size slide

  16. fastlaneͷλεΫͰόʔδϣϯ
    ෇༩
    • ΞΠίϯʹόʔδϣϯ෇༩
    http://nsscreencast.com/episodes/213-icon-badging-with-fastlane

    View full-size slide

  17. stampͰ෇༩
    • github.com/ainoya/stamp
    • go੡ɺCIεΫϦϓτʹຒΊࠐΉ͚ͩ

    View full-size slide

  18. ര଎഑෍Ͱ͖ΔΑ͏ʹͳ͚ͬͨͲ…
    Ϣʔβଟ਺ͳΒͰ͸ͷ໰୊͕

    View full-size slide

  19. Ϣʔβ਺ଟ͍ͳΒͰ͸ͷ໰୊
    • ආ͚ͯ௨Εͳ͍ͷ͕Ϣʔβ؅ཧ
    • ݖݶ؅ཧ
    • IDΫϦʔχϯά
    • ౳ʑ…

    View full-size slide

  20. ن໛େ͖Ίͷ૊৫Ͱͷ

    Ϣʔβ؅ཧ͋Δ͋Δ
    • ਃ੥->(ঝೝ)->ొ࿥ͷ࡞ۀ
    ͕໘౗
    • ݖݶʢ։ൃऀɾςελʔʣ
    ͷίϯτϩʔϧ͕໘౗
    • ΞΧ΢ϯτ਺Ͱ՝ۚͳͷͰ
    Ή΍Έʹ਺;΍ͨ͘͠ͳ
    ͍…

    View full-size slide

  21. ֎෦αʔϏεଆͷ؅ཧը໘Ͱ

    खಈઃఆ͢Δͷ͸ݶք
    • Φϖϛε͕ࢥΘ͵Πϯγσϯτͷݩʹ…

    View full-size slide

  22. Infrastrucuture as codeԽͯ͠
    ͠·͓͏ʂʂ
    • AWSҎ֎ͷSaaSͷઃఆ΋codeͰҰݩ؅ཧ͢
    Δ࣌୅དྷͯ·͢

    View full-size slide

  23. Ϣʔβ؅ཧ΋code؅ཧʹͯ͠
    ͠·͍·͠ΐ͏ɻ

    View full-size slide

  24. terraformͰɻ

    View full-size slide

  25. recruit-mp/terraform-
    provider-deploygate ͷ͝঺հ
    • (deploygate apiͷgoΫϥΠΞϯτ

    recruit-mp/go-deploygate΋ఴ͑ͯ…)

    View full-size slide

  26. ͜Ε͸Կ
    • terraformͷpluginͰ͢
    • terraform/builtin/githubϓϥάΠϯΛࢀߟʹ
    ͠ͳ͕Β࡞Γ·ͨ͠

    View full-size slide

  27. Կ͕Ͱ͖Δ͔
    • PersonalͰެ։ͨ͠ΞϓϦ΁ͷ

    Ϣʔβݖݶ௥Ճɾ࡟আ
    • Organization΁ͷϢʔβ௥Ճɾ࡟আ
    • ެ։APIͰͰ͖Δ͜ͱΛҰ௨Γαϙʔτ

    View full-size slide

  28. ࢖͍ํ
    • terraformͷ࢖͍ํʹ४͡·͢
    • terraform-provider-deploygateΛ

    go buildͯ͠terraformͷόΠφϦͱ

    ಉσΟϨΫτϦʹ഑ஔ

    View full-size slide

  29. ઃఆϑΝΠϧͷهड़

    View full-size slide

  30. terraform plan/applyͰ

    ઃఆΛαʔϏεʹద༻
    • "terraform plan"Ͱద༻಺༰Λ֬ೝ

    View full-size slide

  31. terraform plan/applyͰ

    ઃఆΛαʔϏεʹద༻
    • "terraform apply"ͰઃఆΛద༻

    View full-size slide

  32. Ϣʔβઃఆas codeͷϝϦοτ
    • git؅ཧʹͳΔͷͰɺൃߦཤྺ͕࢒Δʢ؂ࠪϩ
    άͷ୅ΘΓʹ΋ͳΔ)
    • ϓϧϦΫϕʔεͰͷਃ੥ϑϩʔͳͲϫʔΫϑ
    ϩʔͮ͘Γ͕༰қ

    View full-size slide

  33. ·ͱΊ
    • deploygateര଎ศར
    • ໘౗ͳϢʔβ؅ཧ͸؅ཧը໘Ͱ

    ΍Βͳ͍ͰterraformΛ࢖͏ͱ

    ΋΍΋΍ײ͕͖ͬ͢Γ☺
    • deploygate api͸؅ཧܥͷ

    ΤϯυϙΠϯτ௥Ճʹظ଴

    View full-size slide

  34. ෇࿥ɾterraform provider࡞੒
    ͷࢀߟʹͨ͠ࢿྉ
    • goॻ͚ΔਓͳΒҙ֎ͱ؆୯ɻ൒೔͙Β͍Ͱ࡞Ε·ͨ͠ɻ
    • hashicorp/terraform/builtin ҎԼͷprovider܈ͷίʔυΛಡΉ
    ͱཧղ͕ૣ͍ͱࢥ͍·͢
    • (ྑهࣄ)TerraformͷProviderΛ࡞ͬͨ - tkak's tech blog 

    http://tkak.hatenablog.com/entry/2014/11/07/074044
    • ͔Θ͍͍ϑϦʔૉࡐू ͍Β͢ͱ΍ 

    http://www.irasutoya.com/

    View full-size slide