Capistrano 是一个用于管理远程服务器和自动化远程任务的实用工具。它被广泛用于部署 Rails 应用程序(但也能做很多其他事情!)。版本 2.2.0 现已发布(是的,已经发布了,您可能需要等待文件同步到 gem 镜像)。
gem install capistrano
版本 2.2.0 包含以下更改:
功能:动态角色定义。role() 方法现在接受一个块,该块应返回一个主机名、一个 Capistrano::ServerDefinition 对象、一个主机名数组或一个 Capistrano::ServerDefinition 对象数组。这可用于在运行时描述角色的服务器。
role :app do hosts = some_method_that_looks_up_the_current_hosts hosts[0,3] end
功能:使用 server() 方法进行服务器为中心的替代角色定义。
role :app, "server" role :web, "server" # the above is the same as this: server "server", :app, :web
功能:支持任务中的 :max_hosts 选项,该选项将任务限制为仅执行
task :ping, :max_hosts => 100 do # anything here will only run against 100 hosts at a time end # alternatively, you can pass :max_hosts to the run command itself for # finer granularity task :pong do # this will run on ALL hosts at once run "something" # this will run on no more than 100 hosts at a time run "something-else", :max_hosts => 100 end
增强:改进了 Git 支持!
增强:Mercurial SCM 支持密码提示。
增强:实现 Bzr#next_revision 以正确报告待处理的更改,并使用 checkout —lightweight 而不是 branch。
增强:为 Perforce SCM 恢复 :p4sync_flags 和 :p4client_root 变量。
此外,还修复了几个小的 bug 和拼写错误。您可以查看 CHANGELOG 以了解所有详细信息。
一如既往,请通过 Rails trac 报告 bug,地址是 http://dev.rubyonrails.org。如果您还没有订阅 Capistrano 邮件列表,那里是所有酷炫的 capistrano 用户聚集的地方。