Capistrano返回错误的release_path

我有一个关于capistrano版本3.2.1的问题。 在我的deploy.rb文件中,我使用以下行:

set :theme_path, "#{release_path}/web/app/themes/myproject" 

变量release_path没有显示到最新的release文件夹,比如应该说201409151420 ,但是它指向文件夹current ,所以输出是:

 DEBUG[68031037] Command: cd /var/www/myproject/current/web/app/themes/myproject && ( WP_ENV=staging /usr/bin/env npm install --silent ) 

输出应该是:

 DEBUG[68031037] Command: cd /var/www/myproject/201409151420/web/app/themes/myproject && ( WP_ENV=staging /usr/bin/env npm install --silent ) 

有谁知道,为什么release_path变量没有显示到正确的文件夹?

谢谢您的帮助。

我认为如果你theme_path地评估你的theme_path应该会有效:

set(:theme_path) { "#{release_path}/web/app/themes/myproject" }

 set :theme_path, lambda { "#{release_path}/web/app/themes/myproject" } 

如果未定义release_path则会看到您看到的值(请参阅dsl / paths.rb ):

 def release_path fetch(:release_path, current_path) end 

也就是说, release_path的默认值是current_path

Interesting Posts