Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Continuous Deployment with Go on AWS ECS
Search
Kazuhisa Togo
December 12, 2016
Programming
1
4k
Continuous Deployment with Go on AWS ECS
Kazuhisa Togo
December 12, 2016
Tweet
Share
More Decks by Kazuhisa Togo
See All by Kazuhisa Togo
AWS・Hubot・Slackで ChatOpsする話[実装編]
ktogo
0
840
Golangで支えるハイパフォーマンスAPI
ktogo
6
2.9k
SIMD meets ES7
ktogo
0
97
Other Decks in Programming
See All in Programming
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
540
テスト自動化失敗から再挑戦しチームにオーナーシップを委譲した話/STAC2024 macho
ma_cho29
1
1.3k
Haze - Real time background blurring
chrisbanes
1
510
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
140
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
110
バグを見つけた?それAppleに直してもらおう!
uetyo
0
180
快速入門可觀測性
blueswen
0
350
DevFest Tokyo 2025 - Flutter のアプリアーキテクチャ現在地点
wasabeef
5
910
103 Early Hints
sugi_0000
1
230
Jakarta EE meets AI
ivargrimstad
0
240
42 best practices for Symfony, a decade later
tucksaun
1
180
rails stats で紐解く ANDPAD のイマを支える技術たち
andpad
1
290
Featured
See All Featured
Being A Developer After 40
akosma
87
590k
Practical Orchestrator
shlominoach
186
10k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
170
Producing Creativity
orderedlist
PRO
341
39k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
Become a Pro
speakerdeck
PRO
26
5k
Visualization
eitanlees
146
15k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
28
900
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Transcript
Continuous Deployment with Go on AWS ECS Kazuhisa Togo
Kazuhisa Togo a backend developer works at kazuhisa.togo
Kazuhisa Togo some British financial company some web dev company
in Sydney freelancer, etc.
None
ෳͷϚΠΫϩαʔϏεʹ ౷ҰͷΞΧϯτΛఏڙ
Service Service Service Account Account Account Account Account Account ͕ͳ͍ͱ͖
Service Service Service O A uth 2 OAuth 2 OAuth
2 Account Account ͕͋Δͱ͖
API/Core → Go Backend → PHP Front end → Angular
ࠓͷ͓
Continuous Deployment
https://puppet.com/blog/continuous-delivery-vs-continuous-deployment-what-s-diff
࠷ॳͷσϓϩΠखॱ
ϩʔΧϧͰςετ
ssh ϩʔΧϧͰςετ
ssh go get ϩʔΧϧͰςετ
ssh go get go build ϩʔΧϧͰςετ
ssh go get go build restart ϩʔΧϧͰςετ
ssh go get go build restart खಈ खಈ खಈ ϩʔΧϧͰςετ
खಈ
͍͚ͯͳ͍
ssh go get go build restart ϩʔΧϧͰςετ → ͔͔࣌ؒΔ
ssh go get go build restart ϩʔΧϧͰςετ → ةݥ →
͔͔࣌ؒΔ
ssh go get go build restart ϩʔΧϧͰςετ → αʔόʔʹιʔεஔ͘ʁ →
ةݥ → ͔͔࣌ؒΔ
ssh go get go build restart ϩʔΧϧͰςετ → αʔόʔʹιʔεஔ͘ʁ →
ةݥ → αʔόʔͰΔʁ → ͔͔࣌ؒΔ
ssh go get go build restart ϩʔΧϧͰςετ → ڪා →
αʔόʔʹιʔεஔ͘ʁ → ةݥ → αʔόʔͰΔʁ → ͔͔࣌ؒΔ
ͦ͏ͩࣗಈԽ͠Α͏
CIͰςετࣗಈԽ
ssh go get go build restart ϩʔΧϧͰςετ ✔
͍ͭͰʹϏϧυ
ssh go get go build restart ϩʔΧϧͰςετ ✔ ✔ ✔
CodeDeployͱΈ߹Θͤͯ Continuous Deployment
CodeDeploy S3 EC2 ͓͓·͔ͳྲྀΕ
CodeD S3 ϦϙδτϦʹ git push
CodeD S3 GitHub Hook
CodeD S3 ϒϥϯνͷσʔλΛऔಘ Ϗϧυˍςετ
CodeDeploy S3 E σϓϩΠ༻ͷϑΝΠϧҰࣜΛΞʔΧΠϒ S3ʹసૹ
CodeDeploy S3 EC2 ४උ͕Ͱ͖ͨΒCodeDeployݺͼग़͠
CodeDeploy S3 EC2 S3͔ΒΞʔΧΠϒΛμϯϩʔυ ల։ɾΠϯετʔϧ
CodeDeploy S3 EC2 ΞϓϦέʔγϣϯͷ࠶ىಈ
CodeDeploy S3 EC2 git push ͰσϓϩΠ·Ͱ࣮ߦ
ssh go get go build restart ϩʔΧϧͰςετ ✔ ✔ ✔
✔ ʁ
ssh go get go build restart ϩʔΧϧͰςετ ✔ ✔ ✔
✔ ʁ → ·ͩڪා
ຊ൪≠ϩʔΧϧڥ
ຊ൪ΛϩʔΧϧͰ࠶ݱ͍ͨ͠
ίϯςφʹΑΔԾԽ
ຊ൪ͱαʔόʔͰಉ͡ڥ
͔͠͠…
None
GCP͡Όͳ͍
ͳʹ͔ΘΓʹͳΔͷ…ʁ
EC2 Container Service
EC2 ECS ECR ECSͷΈ
EC2 ECS ECR ؋Ϛγϯ DockerίϯςφΛΒͤΔ
EC2 ECS ECR DockerίϯςφͷϚωδϝϯτ ࢮ׆ࢹͳͲ
EC2 ECS ECR DockerΠϝʔδͷϓϥΠϕʔτஷଂݿ
EC2 ECS ECR 3ͭ߹ΘͤͯDockerίϯςφཧ
͜ΕͰઓ͑Δ…ʂʁ
͔͠͠ݱ࣮͔ͬͨ
Write Test Run Build Test Run
Write Test Run Build Test Run ✔
Write Test Run Build Test Run ✔ ✔
Write Test Run Build Test Run ✔ ✔ ✘ FAIL
ຊ൪ͱαʔόʔ ಉ͡ڥ ✔ ✔ ✘
ຊ൪ͱαʔόʔ ಉ͡ڥ Alpine Linux ✔ ✔ ✘
CircleCI࣮Dockerϕʔε ✔ ✔ ✘
ͨͩ͠Ubuntu ✔ ✔ ✘
Mac্ͷDockerͰಈ͔ͳ͍ ✘ ✔ ✘ FAIL
͕ͩMacͰϏϧυͨ͠ϑΝΠϧOK ✔ ✔ PASS
UbuntuͳΒಈ͘ ✔ ✔ ✔ PASS
ݪҼ͍ͭ͜ ✔ ✔ ✘
ڥґଘ ✔ ✔ ✘
͡Ό͋ಉ͡ڥʹ͠Α͏ ✔ ✔ ✘
ͰCircleCIͷίϯςφUbuntu͔͠ͳ͍ ✔ ✔ ✘
✔ Docker on Docker
✔ ✔ ڥΛશ౷Ұ
✔ ✔ ಈ͍ͨʂ ✔ PASS
ssh go get go build restart ϩʔΧϧͰςετ ✔ ✔ ✔
✔ ✔
σϓϩΠ͏ා͘ͳ͍ʂ
ࣗಈԽͱڥ౷ҰͰ ແବͷͳ͍ΞδϟΠϧੜ׆Λ
Enjoy Fearless Deployment!