开发者

How to login to ssh with capistrano, run a couple of commands

开发者 https://www.devze.com 2023-01-28 03:05 出处:网络
instead of the standard capistrano deploy flow for a rails app, I just want mine to login to my server via ssh (I have a key setup), cd to the app, run svn update, run migrations and then restart Pass

instead of the standard capistrano deploy flow for a rails app, I just want mine to login to my server via ssh (I have a key setup), cd to the app, run svn update, run migrations and then restart Passenger.

However, I am having difficulty finding any good do开发者_Go百科cumentation to start me along the right path.

Any ideas?


Wouldn't it be something like this?

namespace :deploy do
  task :upgrade, :roles => [:app] do
    invoke_command "cd #{current_path} && svn up"
    invoke_command "cd #{current_path} && rake db:migrate RAILS_ENV=production"
    invoke_command "cd #{current_path} && touch tmp/restart.txt"
  end
end

Could be cleaner I guess...

The wiki is quite good: https://github.com/capistrano/capistrano/wiki

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号