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
310
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.2k
Practices_for_improving_freee_development_productivity
hikarumiyazawa
0
2.9k
ArgoCD_version_up_merit_and_precaution
hikarumiyazawa
1
540
current_status_and_future_of_freee_deployment_flow
hikarumiyazawa
0
19k
Other Decks in Technology
See All in Technology
飲食店データの分析事例とそれを支えるデータ基盤
kimujun
0
110
The Role of Developer Relations in AI Product Success.
giftojabu1
0
130
100 名超が参加した日経グループ横断の競技型 AWS 学習イベント「Nikkei Group AWS GameDay」の紹介/mediajaws202411
nikkei_engineer_recruiting
1
170
OCI Network Firewall 概要
oracle4engineer
PRO
0
4.1k
データプロダクトの定義からはじめる、データコントラクト駆動なデータ基盤
chanyou0311
2
320
これまでの計測・開発・デプロイ方法全部見せます! / Findy ISUCON 2024-11-14
tohutohu
3
370
誰も全体を知らない ~ ロールの垣根を超えて引き上げる開発生産性 / Boosting Development Productivity Across Roles
kakehashi
1
230
10XにおけるData Contractの導入について: Data Contract事例共有会
10xinc
6
650
Shopifyアプリ開発における Shopifyの機能活用
sonatard
4
250
SSMRunbook作成の勘所_20241120
koichiotomo
2
150
The Rise of LLMOps
asei
7
1.6k
Flutterによる 効率的なAndroid・iOS・Webアプリケーション開発の事例
recruitengineers
PRO
0
110
Featured
See All Featured
Facilitating Awesome Meetings
lara
50
6.1k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
GitHub's CSS Performance
jonrohan
1030
460k
Site-Speed That Sticks
csswizardry
0
26
Happy Clients
brianwarren
98
6.7k
Designing the Hi-DPI Web
ddemaree
280
34k
GraphQLとの向き合い方2022年版
quramy
43
13k
A better future with KSS
kneath
238
17k
Speed Design
sergeychernyshev
25
620
How to Think Like a Performance Engineer
csswizardry
20
1.1k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
How to train your dragon (web standard)
notwaldorf
88
5.7k
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
͝ਗ਼ௌ ͋Γ͕ͱ͏͍͟͝· ͨ͠ʂ