windows - Prepare a Rails environment in a virtual machine with a single click -


i learning develop rails on windows. rails implementation far perfect on windows, use virtual machine launch various rails tools , servers, using vagrant.

each time start environment, following :

  • open 4 conemu powershell tabs in folder
  • in first tab, subl ., vagrant up , wait finish
  • vagrant ssh (it uses ssh client "git windows" installation, guess it's openssh) in first 3 tabs cd /vagrant in each
  • in first tab, rake db:migrate rake test:prepare
  • in first tab, rails s ; in second tab, guard -pc
  • the fourth tab left alone, it's used git commands

can envision script, or series of scripts, can launch these commands ? can think of convoluted way of how open 4 tabs , launch vagrant ssh (i didn't check if worked yet), don't know if it's possible handle ssh sessions way.

here starting point. create powershell script (runvg.ps1 example)

start-process "vagrant" "up" -wait -nonewwindow start-process "vagrant" "ssh", "-new_console:s1thb" -wait start-process "vagrant" "ssh", "-new_console:s1tvb" -wait start-process "powershell" "-new_console:s2tvb" & "vagrant" "ssh" 

and run conemu following command line (change path runvg.ps1 accordingly)

conemu /cmd powershell -noexit -command "c:\vagrant\runvg.ps1" 

after finishing script execution connected ssh in first 3 tab , powershell in fourth tab. actually, you'll 2x2 splits, not tabs. if don't need splits - use plain "-new_console".

now, need pass additional arguments ssh instances running commands in tabs. consult ssh manual or competent users.

upd1 pasting console example (this must called conemu's console)

conemuc /guimacro paste(2,"echo abc\necho def\n") 

Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -