Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Tmux Tips vol.02

Riki Shimma
February 02, 2018

Tmux Tips vol.02

tmux and tmuxinator and more

Riki Shimma

February 02, 2018
Tweet

More Decks by Riki Shimma

Other Decks in Programming

Transcript

  1. tmuxinator • tmux session͸شൃੑ͕͋Γɺ࠶ىಈ͢Δͱফ͑Δ • pane/windowΛ໊લ͚ͭͯอଘग़དྷͨΒศར͡Όͳ͍ʁͱ͍ ͏ࢥ૝͔Βੜ·Εͨ • ݸਓతʹ͸ඞཁੑ͸௿͍ͱ΋ࢥ͏ •

    https://qiita.com/shimma/items/7429bc74c235d6af6442 • 2014೥͘Β͍ʹྲྀߦͨ͠ • golangͷ࣮૷ΛࢼΈΔऀୡ͕͍Δ͕ɺܾఆ൛͸ͳ͍
  2. 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"
  3. 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ίϚϯυΛୟ͘
  4. ࠓճ͸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"