Skip to content

Instantly share code, notes, and snippets.

@dhiemstra
Created April 6, 2015 08:54
Show Gist options
  • Save dhiemstra/d12eea5b5ebd28e250f1 to your computer and use it in GitHub Desktop.
Save dhiemstra/d12eea5b5ebd28e250f1 to your computer and use it in GitHub Desktop.
Rake task to execute some common rails commands on Engineyard
APP_NAME='..'
PATH="/data/#{APP_NAME}/current"
namespace :ey do
desc "Open production rails console"
task :console do
exec "ey ssh -t 'cd #{PATH} && bin/rails console production'"
end
desc "Open production psql command"
task :dbconsole do
exec "ey ssh -t 'cd #{PATH} && bin/rails dbconsole production -p'"
end
desc "Tail production log"
task :logs do
exec "ey ssh -t 'tail -n 500 -f #{PATH}/log/production.log'"
end
end
@dhiemstra
Copy link
Author

Don't forget to add gem 'engineyard' to your Gemfile's development group.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment