mina-deploy / mina

Blazing fast deployer and server automation tool
https://rubygems.org/gems/mina
Other
4.36k stars 491 forks source link

add a task to open a database console #672

Closed djordjelacmanovic closed 3 years ago

djordjelacmanovic commented 3 years ago

Added support for running rails dbconsole, which opens an interactive command line interface to the app's database.

lovro-bikic commented 3 years ago

Thanks for the PR, however, we decided not to add this functionality to core. The reason is, we already support executing arbitrary Rails/Rake tasks, which you can invoke from CLI like this:

mina "rails[dbconsole]"

This will have the same effect as your proposed solution.

If you use this task often, you can also add it to your config/deploy.rb:

task :dbconsole do
  invoke :rails, 'dbconsole'
end

which you can then invoke from CLI: mina dbconsole

You can do the same with Rake tasks: mina "rake[dbconsole]"