The common intruments of mina deployment tool

Rails, mina

This post is about mina deployment tool.

mina is a popular deployment tool for Rails Application.

mina help & debug instruments

mina -T : show all instruments and their briefs

mina -h : show its help text

The most common instruments for mina

mina deploy : deploy the newest version Rails Application from specified git branch( it depends on deploy file ).

mina console : access the console of server's Rails environment, it's very useful for debuging online.

mina rake[arguments] : Execute a Rake command in the current deploy, it's the same easy as local. e.g. mina 'rake[db:seed]'

unicorn relevant

mina unicorn:restart : restart unicorn server( with hot restart )

mina unicorn:stop : stop unicorn

mina unicorn:start : start unicorn

mina unicorn_logs : display the unicorn logs

Notice: it depends on the plugin of mina-unicorn

some useful tips

Q: How can I locate the bug on deploy file?

mina deploy -S : instead of deploying a new appliation, mina will run in simulation mode, just show the bash shell script. the instrument can be replaced by any validatable command.

mina deploy -v : it will output a lot of useful echo information for running command.

Q: How can I quickly find a 500 error?

mina logs : it will quickly show the production log in real time.

it's not a default instrument but we can easily add:

desc "Shows logs."
task :logs do
  queue %[cd #{deploy_to!}/current && tail -f log/production.log]
end

conclusion

It's a good idea to share my experience on the deployment of Ruby on Rails.

mina is a cool tool of deployment and automation for Ruby on Rails Application.

Published at 2015.05.26


abc • 2016-05-24 04:22

Thanks

windy • 2016-05-20 22:07

Hi, Weclome to my blog!

futyfgu • 2016-05-20 22:00

futgy

xprimes • 2015-05-26 23:58

Great Post,