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

CircleCIを活用して AWSへの継続的デリバリーを 実践する

CircleCIを活用して AWSへの継続的デリバリーを 実践する

https://trident-qa.connpass.com/event/310009/ のイベントの登壇資料です。

coconala_engineer

March 27, 2024
Tweet

More Decks by coconala_engineer

Other Decks in Programming

Transcript

  1. Copyright coconala Inc. All Rights Reserved. 2 ࣗݾ঺հ ٢઒୓ݟʢΑ͔͠Θ ͨ͘Έʣ

    • ੜ·Ε ੩Ԭ → จܥେֶ͔ΒΤϯδχΞ΁ • ܦྺ ۚ༥SIer → ελʔτΞοϓ → ίίφϥ • झຯ ϥΠϒɾΠϕϯτʹߦ͘
  2. Vision Ϗδϣϯɺϛογϣϯʹج͍ͮͨࣄۀΛల։ νʔϜ͕ߏங͍ͨ͠ͱࢥ ͏࠷ྑͳະདྷͷΠϝʔδ νʔϜ͕ߏங͍ͨ͠ͱࢥ ͏࠷ྑͳະདྷͷΠϝʔδ Mission νʔϜ͕࣮ݱ͍ͨ͠த৺ తͳ໨తʢଘࡏҙٛʣ ҰਓͻͱΓ͕ʮࣗ෼ͷετʔϦʔʯΛੜ͖͍ͯ͘ੈͷதΛ࡞Δ

    ݸਓͷ஌ࣝɾεΩϧɾܦݧΛՄࢹԽ͠ɺ ඞཁͱ͢Δ͢΂ͯͷਓʹ݁ͼ͚ͭɺ ݸਓΛΤϯύϫʔϝϯτ͢ΔϓϥοτϑΥʔϜΛఏڙ͢Δ ஌ࣝɾεΩϧɾܦݧͷϚονϯάαʔϏεΛల։ ࣄۀ಺༰ 3
  3. Copyright coconala Inc. All Rights Reserved. 5 ΞδΣϯμ • CI/CDͱ͸

    ◦ ͳͥඞཁͳͷ͔ • CircleCIͷಛ௃ • ίίφϥͰͷར׆༻ ◦ ͪΐͬͱͨ͠ςΫχοΫ
  4. Copyright coconala Inc. All Rights Reserved. 8 CI/CDͱ͸ • ݫີʹ͸CIͱCD͸ผͰ͸͋Δ͕ɺͻͱ͘͘ΓͰઆ໌͞ΕΔ͜ͱ͕ଟ͍

    ◦ CIɿܧଓతΠϯςάϨʔγϣϯ ◦ CDɿܧଓతσϦόϦʔ • ΋ͷͬ͘͘͢͟͝ΓҰݴઆ໌͢Δͱ ◦ CIɿࣗಈςετ ◦ CDɿࣗಈσϓϩΠ ɹ→ Ұ࿈ͷྲྀΕʢύΠϓϥΠϯʣ͕͋Δ
  5. Copyright coconala Inc. All Rights Reserved. 14 ͳͥCI/CDύΠϓϥΠϯΛ૊Ήͷ͔ • ίʔυ඼࣭ͷ޲্

    ◦ खಈ࡞ۀΛ͕શͯࣗಈԽ͢Δ͜ͱʹΑΔώϡʔϚϯϦεΫɾίετͷ࡟ݮ ◦ ςετϓϩηεΛ௨͢͜ͱʹΑΔόάͷൃݟ • ੡඼ϦϦʔεαΠΫϧͷߴ଎Խ ◦ ϝΠϯϒϥϯνͷঢ়ଶͰର৅؀ڥʹϦϦʔε͞ΕΔ
  6. Copyright coconala Inc. All Rights Reserved. 15 ͳͥCI/CDύΠϓϥΠϯΛ૊Ήͷ͔ • ίʔυ඼࣭ͷ޲্

    ◦ खಈ࡞ۀΛ͕શͯࣗಈԽ͢Δ͜ͱʹΑΔώϡʔϚϯϦεΫɾίετͷ࡟ݮ ◦ ςετϓϩηεΛ௨͢͜ͱʹΑΔόάͷൃݟ • ੡඼ϦϦʔεαΠΫϧͷߴ଎Խ ◦ ϝΠϯϒϥϯνͷঢ়ଶͰର৅؀ڥʹϦϦʔε͞ΕΔ ɹ ։ൃੜ࢈ੑͷ޲্
  7. Copyright coconala Inc. All Rights Reserved. 18 CircleCIͰओʹͰ͖Δ͜ͱ • ੩తղੳʢLintʣ

    • ୯ମςετʢTestʣ • ϦιʔεϏϧυʢBuildʣ • ίʔυͷσϓϩΠʢReleaseʣ etc…
  8. Copyright coconala Inc. All Rights Reserved. 19 CircleCIͷಛ௃ 1. Ϋϥ΢υαʔϏεͷͨΊ࣮ߦ؀ڥΛ؅ཧ͢Δඞཁ͕ͳ͍

    • ࣗಈϏϧυɺςετΛ࣮ߦ͢ΔͨΊʹαʔόΛ༻ҙ͢Δඞཁ͸ͳ͍ ◦ ઃఆϑΝΠϧΛهड़͢Ε͹ɺ࣮ߦ͞ΕΔΑ͏ʹͳΔ • ͨͩ͠ηΩϡϦςΟͷ౎߹্ɺΫϥ΢υ͸NGͱ͍͏৔߹ ◦ Self Hosted Runner·ͨ͸EnterpriseϓϥϯͰରԠՄೳ 1. ͞·͟·ͳVCSʢόʔδϣϯίϯτϩʔϧγεςϜʣʹରԠ • GithubɺGitLabɺBitbucket • ྫ͑͹GithubActionsΛ࢖͍͍ͨ৔߹͸GithubΛ࢖͍ͬͯΔඞཁ͕͋Δ͕ɺ ɹɹCircleCIͰ͸ͦͷΑ͏ͳ੍໿͸΄ͱΜͲͳ͍
  9. Copyright coconala Inc. All Rights Reserved. 20 CircleCIͷಛ௃ 3. άάϥϏϦςΟ͕ͳ͔ͳ͔ߴ͍

    • 2013೥ࠒ͔Β୆಄͍ͯ͠Δ&ݸਓͰແྉར༻ՄೳͳͷͰ৘ใ͕๛෋ • ࠷ۙ͸GithubActions͔΋... 4. σϑΥϧτͰsshσόοάػೳ͋Γ • ઃఆϑΝΠϧΛهࡌͯ͠ɺ ࢥ͏Α͏ʹಈ͔ͳ͍ͱ͖ʹศར • printσόοάΈ͍ͨͳ͜ͱ͕ෆཁ • GithubActions౳Ͱ͸ઐ༻ActionsΛ૊ΈࠐΉ ඞཁ͕͋Δ
  10. Copyright coconala Inc. All Rights Reserved. 21 CircleCIͷಛ௃ 5. Insightػೳ

    • ϦϙδτϦ͝ͱͷ੒ޭ཰ɺύΠϓϥΠϯͷ࣮ߦ࣌ؒ౳ͷ֓ཁΛ֬ೝͰ͖Δ ◦ Ͳ͕͜஗͍ͷ͔ɺվળ༨஍͕͋Δͷ͔͕Ұ໨ͰΘ͔Γ΍͍͢
  11. Copyright coconala Inc. All Rights Reserved. 26 CircleCIΛ༻͍ͯAWS΁σϓϩΠ͢Δ ίίφϥͰ͸EC2ɺECSɺLambda΁ͷσϓϩΠʹCircleCIΛ׆༻ •

    developϒϥϯν΁ϚʔδʹΑΓεςʔδϯάɺ masterϒϥϯν΁ϚʔδʹΑΓຊ൪΁ࣗಈతʹσϓϩΠ͞ΕΔ • CircleCI্ͰLint→test→build→deploy ͕جຊϑϩʔ
  12. Copyright coconala Inc. All Rights Reserved. 27 ͪΐͬͱͨ͠ςΫχοΫ • AWS΍GCP΁σϓϩΠ͢ΔͨΊʹ͸ΞΧ΢ϯτΩʔ͕ඞཁɾɾɾʁ

    ◦ ͩͬͨͷ͸਺೥લ·Ͱͷ࿩ ◦ ݱࡏͰ͸OpenIDConnectͱ͍͏࢓૊ΈͰೝূ͢Δ͜ͱͰΩʔϨε͕Մೳ ◦ ৄ͘͠͸ϒϩάΛࢀর͍͖͍ͨͩͨ
  13. Copyright coconala Inc. All Rights Reserved. 28 ͪΐͬͱͨ͠ςΫχοΫ • OrbsΛͲΜͲΜར༻

    ◦ Orbsͱ͸δϣϒ΍ίϚϯυΛύοέʔδԽͨ͠΋ͷ ▪ ຊདྷ਺ेߦʹ౉ΔίϚϯυͳͲΛγϯϓϧʹهࡌͰ͖Δ ◦ ࣗ෼ͨͪઐ༻ʹPrivate OrbΛ࡞੒͢Δ͜ͱ΋Մೳ ɹɹ ɹ→aws-cliΛར༻͍ͨͨ͠ΊΠϯετʔϧ͍ͨ͠ɻ ɹ ௨ৗ͸wgetʙtarʙmvͳͲهࡌ͢Δඞཁ͕͋Δ͕ ɹ ͜Ε͕ͨͬͨ1ߦʢaws-cli/installʣͰࡁΜͰ͍Δ
  14. Copyright coconala Inc. All Rights Reserved. 29 ͪΐͬͱͨ͠ςΫχοΫ • ςετ͸ฒྻԽͯ͠ߴ଎Խ

    ◦ CI࣮ߦ࣌ؒͷଟ͘ͷׂ߹Λ઎ΊΔͷ͕ςετ޻ఔ ◦ CircleCIͰ͸෼ࢄ࣮ߦͷઃఆ͕Մೳ ◦ ৄ͘͠͸ϒϩάΛࢀর͍͖͍ͨͩͨ ↓ ௚ྻ࣮ߦͰ͸30෼͔͔͍ͬͯͨ΋ͷ͕τʔλϧ6෼ఔ౓ʹ
  15. We are hiring!! ࠾༻ϗʔϜϖʔδ https://coconala.co.jp/recruit ΤϯδχΞ࠾༻ϗʔϜϖʔδ https://coconala.co.jp/recruit/engineer ίίφϥͷਓͱ૊৫Λ఻͑Δϒϩά ίίφϥLIVE https://blog.coconala.co.jp/m/m4e4abe8b17e5

    ਓੜͷՄೳੑΛ޿͛ͨϢʔβʔετʔϦʔ Θͨ͠ͷεΩϧղ์ه https://blog.coconala.co.jp/m/me8a586112ad2 ίίφϥʹॴଐ͢ΔΤϯδχΞʹΑΔϒϩά ςοΫϒϩά https://zenn.dev/coconala 31