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
7.4k
Practices_for_improving_freee_development_productivity
hikarumiyazawa
0
3.9k
ArgoCD_version_up_merit_and_precaution
hikarumiyazawa
1
560
current_status_and_future_of_freee_deployment_flow
hikarumiyazawa
0
20k
Other Decks in Technology
See All in Technology
タイミーのデータ活用を支えるdbt Cloud導入とこれから
ttccddtoki
1
170
Amazon Route 53, 待ちに待った TLSAレコードのサポート開始
kenichinakamura
0
170
Reactフレームワークプロダクトを モバイルアプリにして、もっと便利に。 ユーザに価値を届けよう。/React Framework with Capacitor
rdlabo
0
130
30分でわかる「リスクから学ぶKubernetesコンテナセキュリティ」/30min-k8s-container-sec
mochizuki875
3
450
【NGK2025S】動物園(PINTO_model_zoo)に遊びに行こう
kazuhitotakahashi
0
240
KMP with Crashlytics
sansantech
PRO
0
240
デジタルアイデンティティ技術 認可・ID連携・認証 応用 / 20250114-OIDF-J-EduWG-TechSWG
oidfj
2
690
Cloudflareで実現する AIエージェント ワークフロー基盤
kmd09
0
290
ABWGのRe:Cap!
hm5ug
1
120
Azureの開発で辛いところ
re3turn
0
240
【Oracle Cloud ウェビナー】2025年のセキュリティ脅威を読み解く:リスクに備えるためのレジリエンスとデータ保護
oracle4engineer
PRO
1
100
[IBM TechXchange Dojo]Watson Discoveryとwatsonx.aiでRAGを実現!座学①
siyuanzh09
0
110
Featured
See All Featured
BBQ
matthewcrist
85
9.4k
Building Your Own Lightsaber
phodgson
104
6.2k
Gamification - CAS2011
davidbonilla
80
5.1k
KATA
mclloyd
29
14k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
The Language of Interfaces
destraynor
155
24k
It's Worth the Effort
3n
183
28k
For a Future-Friendly Web
brad_frost
176
9.5k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
192
16k
Reflections from 52 weeks, 52 projects
jeffersonlam
348
20k
Documentation Writing (for coders)
carmenintech
67
4.5k
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
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
͝ਗ਼ௌ ͋Γ͕ͱ͏͍͟͝· ͨ͠ʂ