【发布时间】:2014-11-02 18:45:08
【问题描述】:
我当前的命名空间如下所示:
namespace :deploy do
task :npm_install do
on roles :all do
within release_path do
execute :npm, :install
end
end
end
task :bower_install do
on roles :all do
within release_path do
execute './node_modules/.bin/bower', :install
end
end
end
task :build do
on roles :all do
within release_path do
invoke 'deploy:npm_install'
invoke 'deploy:bower_install'
end
end
end
after :finishing, :build
end
我想知道是否有另一种方法可以避免 roles 和 release_path 的重复和嵌套块。
如何写得更简洁?
【问题讨论】:
-
我在 Internet 上找不到足够的有关 Capistrano 最佳实践和代码重构的信息。
标签: ruby-on-rails capistrano capistrano3