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
Tmux Tips vol.02
Search
Riki Shimma
February 02, 2018
Programming
0
590
Tmux Tips vol.02
tmux and tmuxinator and more
Riki Shimma
February 02, 2018
Tweet
Share
More Decks by Riki Shimma
See All by Riki Shimma
管理画面のチラ見せから日本の決済を変える@管理画面チラ見せナイト#4
shimma
0
140
Other Decks in Programming
See All in Programming
Node.js v22 で変わること
yosuke_furukawa
PRO
11
3.9k
Deep Dive into React Stream/Serialize
mugi_uno
3
660
Ruby Function Composition
bkuhlmann
1
340
From Spring Boot 2 to Spring Boot 3 with Java 21 and Jakarta EE
ivargrimstad
0
520
TCAとKMPを用いた新規動画配信アプリ 「ABEMA Live」の設計
tomu28
2
130
AWS CDKコントリビュートTIPS / aws-cdk-contribution-tips
gotok365
4
380
Code Reviews
bkuhlmann
4
900
Goのmultiple errorsについて (2024年4月版)
syumai
4
1.2k
Goのエラースタックトレースの歴史と今後
sonatard
10
1.8k
Scalable Customer Journey Orchestration (CJO)
lewuathe
0
420
雑に思考を整理する技術と効能
konifar
63
30k
Ruby Pattern Matching
bkuhlmann
0
930
Featured
See All Featured
Gamification - CAS2011
davidbonilla
77
4.6k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
242
1.2M
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
14
1.5k
The Art of Programming - Codeland 2020
erikaheidi
43
12k
Art, The Web, and Tiny UX
lynnandtonic
290
19k
Done Done
chrislema
178
15k
Design by the Numbers
sachag
274
18k
Faster Mobile Websites
deanohume
300
30k
Build your cross-platform service in a week with App Engine
jlugia
226
17k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
188
16k
A designer walks into a library…
pauljervisheath
201
23k
Transcript
Tmux Tips vol.02 tmuxinatorߨ࠲ 2017/12/15 @shimma
ۙͷ OpsWorksܦ༝ͰσϓϩΠ͢Δͱɺrailsଆͷ unicornϓϩηε͕࠶ىಈ͞Εͣɺݹ͍ιʔε ίʔυ͕ಈ͖ଓ͚Δͷଟൃ (NOW) • masterϓϩηε͕ͬͨ··ɺworkerϓϩηε͕ͬͨ·· • API͕1/4ͷ֬Ͱҧ͏σʔλΛฦ͢ (
࠷ߴ)
ۙͷ unicornͷΈ masterϓϩηεʹUSR2γάφϧૹΒΕΔͱɺࣗΛ࠶ىಈ͠ɺ ৽͍͠masterϓϩηεΛϑΥʔΫͨ͠workerϓϩηεੜ·Ε Δ
ղܾͷํੑ • ͻͱ·ͣσϓϩΠޙͷunicornͷϓϩηε͕৽͘͠ͳ͍ͬͯΔ ͷ͔֬ೝ͢Δ • (͋ͱࠜຊతʹOpsWorks͔ΒҾӽ͠Λ͍ͨ͠)
tmuxͷग़൪
tmuxinator • tmux sessionشൃੑ͕͋Γɺ࠶ىಈ͢Δͱফ͑Δ • pane/windowΛ໊લ͚ͭͯอଘग़དྷͨΒศར͡Όͳ͍ʁͱ͍ ͏ࢥ͔Βੜ·Εͨ • ݸਓతʹඞཁੑ͍ͱࢥ͏ •
https://qiita.com/shimma/items/7429bc74c235d6af6442 • 2014͘Β͍ʹྲྀߦͨ͠ • golangͷ࣮ΛࢼΈΔऀୡ͕͍Δ͕ɺܾఆ൛ͳ͍
install gem install tmuxinator
how to use tmuxinator edit prod tmuxinator prod # ~/.tmuxinator/prod.yml
name: demo-production root: /Users/shimma/src/github.com/shimma/demo windows: - production: panes: - ssh demo01 -t "cd /srv/www/demo/current && sudo -u deploy RAILS_ENV=production bin/rails console" - sleep 2 && ssh demo02 -t "cd /srv/www/demo/current && sudo -u deploy RAILS_ENV=production bin/rails dbconsole -p"
sample # ~/.tmuxinator/anypay.yml name: anypay root: /Users/shimma/src/github.com/shimma/demo windows: - production:
panes: - ssh demo01 - ssh demo02 - ssh demo03 - ssh demo04 # ଓޙʹsynchronized panesޙʹpsίϚϯυΛୟ͘
͔͠͠
ࠓճMakefileͰे check-unicorn-process: ssh demo01 "hostname && ps aux | grep
unicorn" ssh demo02 "hostname && ps aux | grep unicorn" ssh demo03 "hostname && ps aux | grep unicorn" ssh demo04 "hostname && ps aux | grep unicorn"
݁ جຊతʹMakefileShellScriptͰྃग़དྷΔΑ͏ʹ͢Δ͠ Ͳ͏ͯ͠ΠϯλϥΫςΟϒͳॲཧ͕ඞཁͳ࣌ʹtmuxinatorΛ׆༻͢Δ͠