Capistrano返回错误的release_path [英] Capistrano returning wrong release_path
问题描述
set:theme_path,#{release_path} / web / app / themes / myproject
变量release_path没有显示到最新版本文件夹,可以说 201409151420 ,因为它应该指向文件夹 current ,所以输出为:
DEBUG [68031037]命令:cd / var / www / myproject / current / web / app / themes / myproject&& (WP_ENV = staging / usr / bin / env npm install --silent)
输出应该是:
DEBUG [68031037]命令:cd / var / www / myproject / 201409151420 / web / app / themes / myproject&& amp ; (WP_ENV = staging / usr / bin / env npm install --silent)
有谁知道,为什么release_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_p的默认值ath
是 current_path
。
I have a question about capistrano version 3.2.1. In my deploy.rb file I'm using the following line:
set :theme_path, "#{release_path}/web/app/themes/myproject"
The variable release_path is not showing to latest release folder, lets say 201409151420 as it should, but it is pointing to folder current, so the output is:
DEBUG[68031037] Command: cd /var/www/myproject/current/web/app/themes/myproject && ( WP_ENV=staging /usr/bin/env npm install --silent )
The output should be:
DEBUG[68031037] Command: cd /var/www/myproject/201409151420/web/app/themes/myproject && ( WP_ENV=staging /usr/bin/env npm install --silent )
Does anyone know, why the release_path variable isn't showing to the proper folder?
Thank you for your help.
I think it should work if you evaluate your theme_path
lazily:
set(:theme_path) { "#{release_path}/web/app/themes/myproject" }
set :theme_path, lambda { "#{release_path}/web/app/themes/myproject" }
The value you are seeing is expected if release_path
is not defined (see dsl/paths.rb):
def release_path
fetch(:release_path, current_path)
end
That is, the default value for release_path
is current_path
.
这篇关于Capistrano返回错误的release_path的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!