2
我當前名字空間看起來是這樣的:不要重複自己在Capistrano的3
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
嵌套塊。
我該如何寫得更簡潔?
我沒有在網上找Capistrano的最佳實踐和代碼重構的足夠的信息。 – 2015-01-31 15:33:36