mina-deploy / mina

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

Plan to support all the rails commands #542

Closed coderhs closed 3 years ago

coderhs commented 7 years ago

Presently I find that the rails db:migrate, rails assets:precompile are supported internally itself. Any plans to support everything? Like rails assets:clean, rails db:schema:load, etc?

or is there any gem that adds all these commands to mina like mina-whenever. I couldn't find any on my research.

d4be4st commented 6 years ago

There aren't. But as of now we haven't found the need for them. If you are willing create a PR as that seems like something that would be considered a core

lovro-bikic commented 3 years ago

Although it generally makes sense to support all Rails commands, we can't support all of them in the core because there's a lot of them, they change with Rails versions, and some are project-dependent.

However, we already support executing arbitrary Rails tasks with a generic rails[task] task. So, if you want to invoke assets:clean, you can do this in CLI:

mina "rails[assets:clean]"

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

task :assets_clean do
  invoke :rails, 'assets:clean'
end

and use it from CLI like so: mina assets_clean

You can invoke any Rails task that way. The same goes for Rake: mina "rake[assets:clean]".