Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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.6k
Practices_for_improving_freee_development_productivity
hikarumiyazawa
0
3.3k
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
Oracle Base Database Service:サービス概要のご紹介
oracle4engineer
PRO
0
15k
深層学習のリペア技術の最新動向と実際 / DNN Repair Techniques for AI Performance Alignment for Safety Requirements
ishikawafyu
0
510
PostgreSQL Conference Japan 2024 A4 Comparison of column-oriented access methods
nori_shinoda
0
150
Empowering Customer Decisions with Elasticsearch: From Search to Answer Generation
hinatades
PRO
0
300
2000年てづくりキーボードの旅
tagomoris
1
170
高品質と高スピードを両立させるソフトウェアQA/Software QA that Supports Agility and Quality
goyoki
10
1.7k
テーブルが200以上あるSaaSでRSCとGraphQLを併用する理由
msickpaler
1
170
新機能Amazon GuardDuty Extended Threat Detectionはネ申って話
cmusudakeisuke
0
270
データパイプラインをなんとかした話 / Improving the Data Pipeline in IVRy
mirakui
0
160
Replit Agent
kawaguti
PRO
2
210
Amazon Bedrock Knowledge BasesがGraphRAGに対応!! ・・・それってつまりどういうコト!? をチョット深堀ってみる
tokushun
0
110
お悩みハンドブック紹介資料
grafferhandbook
0
1.6k
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
Music & Morning Musume
bryan
46
6.2k
How STYLIGHT went responsive
nonsquared
95
5.2k
Six Lessons from altMBA
skipperchong
27
3.5k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
Building an army of robots
kneath
302
44k
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
What's in a price? How to price your products and services
michaelherold
243
12k
The Cost Of JavaScript in 2023
addyosmani
45
6.9k
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
͝ਗ਼ௌ ͋Γ͕ͱ͏͍͟͝· ͨ͠ʂ