0
我有幾個任務,都必須檢查作爲角色的機器是否具有某些具有特定內容的文件。邏輯是合理的分離成先決條件或回調。從Capistrano回調中的父任務繼承角色
task t1, :roles => [:r1] do
...
end
task t2, :roles => [:r2,:r3] do
...
end
before <what?> do
# must only run on :r1 when triggered by t1,
# and only on :r2 and :r3 when triggered by t2!
<ensure role given to parent task has a given file>
end
我們如何在Capistrano做到這一點?