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
CircleCI初心者が、AWS/EC2へWEBページの反映作業を自動化してみた!
Search
hikaru-miyazawa
June 28, 2019
Technology
1
320
CircleCI初心者が、AWS/EC2へWEBページの反映作業を自動化してみた!
hikaru-miyazawa
June 28, 2019
Tweet
Share
More Decks by hikaru-miyazawa
See All by hikaru-miyazawa
Small_Start_Conscious_Development_Productivity_Improvement_Practices_at_freee
hikarumiyazawa
3
6.8k
Practices_for_improving_freee_development_productivity
hikarumiyazawa
0
3.5k
ArgoCD_version_up_merit_and_precaution
hikarumiyazawa
1
550
current_status_and_future_of_freee_deployment_flow
hikarumiyazawa
0
20k
Other Decks in Technology
See All in Technology
第3回Snowflake女子会_LT登壇資料(合成データ)_Taro_CCCMK
tarotaro0129
0
190
ずっと昔に Star をつけたはずの思い出せない GitHub リポジトリを見つけたい!
rokuosan
0
150
【re:Invent 2024 アプデ】 Prompt Routing の紹介
champ
0
140
GitHub Copilot のテクニック集/GitHub Copilot Techniques
rayuron
36
13k
PHP ユーザのための OpenTelemetry 入門 / phpcon2024-opentelemetry
shin1x1
1
200
スタートアップで取り組んでいるAzureとMicrosoft 365のセキュリティ対策/How to Improve Azure and Microsoft 365 Security at Startup
yuj1osm
0
210
OpenAIの蒸留機能(Model Distillation)を使用して運用中のLLMのコストを削減する取り組み
pharma_x_tech
4
560
re:Invent 2024 Innovation Talks(NET201)で語られた大切なこと
shotashiratori
0
310
オプトインカメラ:UWB測位を応用したオプトイン型のカメラ計測
matthewlujp
0
170
祝!Iceberg祭開幕!re:Invent 2024データレイク関連アップデート10分総ざらい
kniino
3
260
KubeCon NA 2024 Recap / Running WebAssembly (Wasm) Workloads Side-by-Side with Container Workloads
z63d
1
250
生成AIのガバナンスの全体像と現実解
fnifni
1
190
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
The Pragmatic Product Professional
lauravandoore
32
6.3k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
66k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Faster Mobile Websites
deanohume
305
30k
Six Lessons from altMBA
skipperchong
27
3.5k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Thoughts on Productivity
jonyablonski
67
4.4k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.4k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
247
1.3M
Transcript
CIRCLECIॳ৺ऀ͕ɺAWS/EC2WEBϖʔδ ͷө࡞ۀΛࣗಈԽͯ͠Έͨʂ MEILY INC INFRA SRE HIKARU MIYAZAWA
2 AGENDA 1. ࣗݾհ 2. CercleCIΛಋೖ͠Α͏ͱࢥͬͨܦҢ 3. CircleCIͰWEBϖʔδͷөࣗಈԽ 4. CircleCIͷIPڐՄͱϒϥϯνʹΑͬͯөઌΛม͑Δ
5. ·ͱΊ
3 HIKARU MIYAZAWA ɾ2016/10ʙ2017/3 લ৬ͰΠϯλʔϯɺΠϯϑϥͷۀOJT ɾ2017/4ʙ2017/11 Πϯλʔϯޙೖࣾ ΠϯϑϥSREνʔϜ ɾ2017/11ʙࠓ·Ͱ גࣜձࣾMeily
ۀ ઐͰΠϯϑϥΛ୲ झຯɿϙέΧ,DQR,͓ञ(ϋΠϘʔϧ͕͖) ͖ͳٕज़ɿFargate,Ansible,Terraform,CircleCI←new!
4 CERCLECIΛಋೖ͠Α͏ͱࢥͬͨܦҢ ▸ HPQ&AͷϖʔδΛߋ৽͢Δͱ͖ʹɺSSHͯ͠υΩϡ ϝϯτϧʔτͰ git pull ͢Δ͜ͱͰߋ৽͍ͯͨ͠ɻ ▸ σβΠφʔ͕SSHίϚϯυϥΠϯΛ͏ඞཁ͕͋ͬͨ
▸ ϝϯόʔ͕৽͘͠PCΛങ͍ସ͑ͨΓॳظԽͨ࣌͠ʹɺ SSHͷઃఆΛ͢͠ͷ͕ͭΒ͍ɻɻ ▸ SSH͢ΔͨΊʹIPڐՄ͢Δඞཁ
5 CERCLECIΛಋೖ͠Α͏ͱࢥͬͨܦҢ ▸ AWS Summit Tokyo 2019ʹࢀՃ͖ͯ͠·ͨ͠ʂ ▸ ༑ਓͷΤϯδχΞʮcircle ci
͍͍ͧʯ ▸ circle ciϒʔεͰฉ͍ͯΈΔʂ ▸ TγϟπΛΒͬͯΔؾʹˡ ▸ ొஃػձΛ͍͖ͨͩ͋Γ͕ͱ͏͍͟͝·͢ʂ
6 CIRCLECIͰWEBϖʔδͷөࣗಈԽ ͍͖ͬͯ·͢ʂ
7 WEBαʔόͷߏ ▸ AWS/EC2 ▸ Route53→CloudFront→ALB→EC2 ▸ OS AmazonLinux ▸
H2O 2.2.4
8 GITHUB࿈ܞͰϩάΠϯ ▸ ϩάΠϯ ▸ GitHub organization Ͱ circleci ͔ΒͷΞΫηεΛڐՄ
▸ Switch Organization Ͱબ
9 CONFIG.YML ▸ .circleci/config.ymlΛ࡞ͯ͠ϓογϡ͠·͢ɻ
10 SET UP PROJECT ▸ ͏ϦϙδτϦͷSetUpProjectΛΫϦοΫ͠·͢ʂ
11 CIRCLECI͋Δ͋Δ ▸ ബ͍ਫ৭ͷϘλϯԡ࣌͢ʹෆ҆ʹͳΔ
12 ԡ͠·͢
13 ઃఆ ࠷ॳࣦഊ͠·͕͢ɺؾʹͤͣઃఆΛ͍͖ͯ͠·͢ɻ
14 SSH伴࡞ ൿີ伴ΛCircleCIʹొ͠ɺެ։伴Λαʔόʹஔ
15 伴ͷొ fingerprintޙ΄ͲίʔυͰ͏ͷͰίϐʔ͓͖ͯ͠·͢ɻ
16 ڥมͷొ HOST_NAMEͱUSER_NAMEΛొ͠·͢
17 ڥมͷొ HOST_NAMEͱUSER_NAMEΛొ͠·͢
18 վΊͯͬͯΈΔ ίʔυΛมߋͯ͠gitʹ͋͛Δ͚ͩͰɻޭʂ
19 վΊͯͬͯΈΔ ίʔυΛมߋͯ͠gitʹ͋͛Δ͚ͩͰɻޭʂ
20 ϖʔδ֬ೝ
21 ແࣄͰ͖͕͍͔࣮ͨͭ͘ݱ͍ͨ͜͠ͱ͕ ‣ ϒϥϯνຖʹผͷαʔόʹө͍ͨ͠ɻ ‣ SSHͬͯΔ͚ͲɺCircleCI͞ΜͷIPຖճมΘΔ͠Ͳ͏ͨ͠ Β͍͍ͷʂ ‣ Ϗϧυத͚ͩCircleCIͷIPڐՄͯ͠ɺϏϧυऴΘͬͨΒϧʔ ϧΛফͤͨΒϕετ
22 CIRCLECIͷIPڐՄͱϒϥϯνʹΑͬͯөઌΛม͑Δ ‣ ͍Ζ͍ΖGoogleௐͯΈΔͱɺ͍͍ײ͡ͷࣄྫ͕͍ͭ͘ ʂ ͬͦͬͯ͘͞Έ·͢ʂ
23 CIRCLECIͷIPڐՄͱϒϥϯνʹΑͬͯөઌΛม͑Δ ‣ AWSCLIΛͬͯөத͚ͩIPڐՄɺऴΘͬͨΒด͡Δ ‣ CLIΛ͏ͨΊIAMͷઃఆ ‣ config.ymlͷॻ͖ํͰϒϥϯνຖʹөઌΛม͑ΒΕΔ ‣ ඞཁͳڥมΛదٓొ
24 IAMͷઃఆᶃ αʔϏεɺIAMɺϙϦγʔɺϙϦγʔͷ࡞ ηΩϡϦςΟάϧʔϓͷૢ࡞ͷΈΛڐՄ͢ΔϙϦγʔΛ࡞
25 IAMͷઃఆᶄ άϧʔϓʹϙϦγʔΛΞλον͠ɺάϧʔϓΛ࡞͠·͢ɻ
26 IAMͷઃఆᶅ Ϣʔβʔ࡞͠·͢ɻ
27 IAMͷઃఆᶆ ઌఔͷάϧʔϓʹՃɻ
28 IAMͷઃఆᶇ ΞΫηεΩʔͱγʔΫϨοτΞΫηεΩʔΛϝϞ͓͖ͯ͠·͢
29 ڥมͷొ DEVͱPRDͦΕͧΕͷڥมΛొ͠·͢ɻ
30 CONFIG.YMLͷղઆᶃ
31 CONFIG.YMLͷղઆᶄ
32 CONFIG.YMLͷղઆᶅ
͍͟PUSHʂ ˠMergeʂ
34 ։ൃɺຊ൪ڞʹޭʂ
35 ·ͱΊ ▸ ө࡞ۀGitʹ͋͛Δ͚ͩʂૣ͍ʂࣗಈԽૉΒ͍͠ ▸ αʔόཧऀͱɺσβΠφʔΤϯδχΞͱͷྖҬΛ໌֬ʹ ͚ΒΕ·ͨ͠ʂ ▸ νϡʔτϦΞϧɺυΩϡϝϯτɺهࣄ͕๛Ͱײँɻɻ ▸
ࠓޙECSͷσϓϩΠࣗಈԽ͍͖͍ͯͨ͠ʂ
36 ࢀߟϦϯΫ ‣ެࣜυΩϡϝϯτ ‣https://circleci.com/docs/ja/ ‣Circle CIͰwebαΠτΛࣗಈσϓϩΠ ‣https://esnetk6.com/2018/04/circle-ci-deployment/ ‣CircleCI2.0͔ΒEC2ʹΞΫηε͢Δͱ͖͚ͩಛఆͷIPΛڐՄ ͍ͨ͠ ‣https://qiita.com/rintaro-ishikawa/items/
02e6a63dbc90ea67a991
͝ਗ਼ௌ ͋Γ͕ͱ͏͍͟͝· ͨ͠ʂ