Created
August 2, 2011 22:30
-
-
Save oliverbarnes/1121395 to your computer and use it in GitHub Desktop.
Automating iterm 2 sessions for a rails 3 project using applescript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- open terminal sessions | |
tell application "iTerm 2" | |
activate | |
set myterm to (make new terminal) | |
tell myterm | |
-- start mongo | |
launch session "Default" | |
tell the last session | |
write text "cd ~/Projects/killerapp; bundle exec rake mongo:start" | |
end tell | |
-- start redcar | |
launch session "Default" | |
tell the last session | |
write text "cd ~/Projects/killerapp; redcar ." | |
end tell | |
-- wait for mongo to finish starting up | |
delay 5 | |
-- start server | |
launch session "Default" | |
tell the last session | |
write text "cd ~/Projects/killerapp; rails server" | |
end tell | |
-- start spork | |
launch session "Default" | |
tell the last session | |
write text "cd ~/Projects/killerapp; bundle exec spork cucumber & bundle exec spork &" | |
end tell | |
-- now wait for spork to finish starting up | |
delay 20 | |
-- run tests for the first time | |
launch session "Default" | |
tell the last session | |
write text "cd ~/Projects/killerapp; bundle exec cucumber ; bundle exec rspec" | |
end tell | |
end tell | |
end tell | |
--way for server to finish starting up | |
delay 10 | |
-- open localhost and dev site on chrome | |
tell i term application "Google Chrome" | |
activate | |
set mywindow to (make new window) | |
tell active tab of mywindow | |
set URL to "http://localhost:3000/" | |
end tell | |
tell mywindow | |
set newTab to make new tab with properties {URL:"http://killerapp.heroku.com/"} | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment