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
非機能品質を作り込むための実践アーキテクチャ
knih
5
1.4k
組織に自動テストを書く文化を根付かせる戦略(2024冬版) / Building Automated Test Culture 2024 Winter Edition
twada
PRO
16
4.1k
Amazon VPC Lattice 最新アップデート紹介 - PrivateLink も似たようなアップデートあったけど違いとは
bigmuramura
0
190
.NET 9 のパフォーマンス改善
nenonaninu
0
940
あの日俺達が夢見たサーバレスアーキテクチャ/the-serverless-architecture-we-dreamed-of
tomoki10
0
460
WACATE2024冬セッション資料(ユーザビリティ)
scarletplover
0
200
OpenAIの蒸留機能(Model Distillation)を使用して運用中のLLMのコストを削減する取り組み
pharma_x_tech
4
560
多領域インシデントマネジメントへの挑戦:ハードウェアとソフトウェアの融合が生む課題/Challenge to multidisciplinary incident management: Issues created by the fusion of hardware and software
bitkey
PRO
2
110
統計データで2024年の クラウド・インフラ動向を眺める
ysknsid25
2
840
2024年にチャレンジしたことを振り返るぞ
mitchan
0
140
新機能VPCリソースエンドポイント機能検証から得られた考察
duelist2020jp
0
220
Snykで始めるセキュリティ担当者とSREと開発者が楽になる脆弱性対応 / Getting started with Snyk Vulnerability Response
yamaguchitk333
2
180
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
Making the Leap to Tech Lead
cromwellryan
133
9k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
Automating Front-end Workflow
addyosmani
1366
200k
The Language of Interfaces
destraynor
154
24k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Code Reviewing Like a Champion
maltzj
520
39k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Facilitating Awesome Meetings
lara
50
6.1k
Building an army of robots
kneath
302
44k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
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
͝ਗ਼ௌ ͋Γ͕ͱ͏͍͟͝· ͨ͠ʂ