2010-08-02 83 views
4

我有一個capistrano任務,它整合了Rails項目多個階段的部署。從capistrano任務中調用多級capistrano任務

例如:

task :consolidated_task do 
    build #creates a new release branch from master, 
      #sets a variable with the relese branch name 

    staging 
    deploy.migrations 

    production 
    deploy.migrations 
end 

這是從另一個調用帽任務多級任務的正確方法?

構建任務創建一個新的git分支併發布它。新分支的名稱被保存爲capistrano變量。階段和生產階段任務然後使用這個變量來指定從哪個分支進行部署。

fatal: working tree '/Users/<my working directory>' already exists. 
/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.5.19/lib/capistrano/recipes/deploy/strategy/copy.rb:99:in `initialize': No such file or directory - /var/folders/3d/3dKYNUwQGOSLZFXsMF-uv++++TM/-Tmp-/20100802182750/REVISION (Errno::ENOENT) 

我是從我的本地機器推源爲Git倉庫和部署機器無法相互通信:

當此任務運行時,它會失敗。

+0

現在是100%。我一定是一個權力使用者! – manlycode 2010-08-03 12:49:14

回答

7

deploy:production:whatever 

任務名內蓋暴露

deploy.production.whatever 

您還可以top命名空間去命名空間的頂部,因爲路徑是相對的。

因此,不管在哪個命名空間你的任務是目前你可以隨時做thigs,如:

top.deploy.production.whatever 
相關問題