How to run shell commands on server in Capistrano v3?

孤者浪人 提交于 2019-11-29 19:34:54

In Capistrano v3, you must specify where you want to run the code by calling on with a list of hostnames, e.g.

task :execute_on_server do
  on "root@example.com" do
    execute "some_command"
  end
end

If you have roles set up, you can use the roles method as a convenience:

role :mailserver, "root@mail.example.com"

task :check_mail do
  on roles(:mailserver) do
    execute "some_command"
  end
end

There is some v3 documentation here: http://www.capistranorb.com/

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!