我是Capistrano(v 3.2.1)的绝对新手,请原谅我的错误,无用。我正在部署一个PHP应用程序,并希望在部署之前运行作曲家安装:symlink:release任务(仅在未运行回滚时)部署前运行任务:符号链接:共享capistrano 3
我无法访问新创建的版本目录,因为我需要它能够进入它并运行作曲家(并运行其他一些项目)。我现在有;
namespace :deploy do
namespace :symlink do
desc 'Run composer'
task :runcomposer do
on roles :all do
execute "cd '#{current_release}' && composer install"
execute "cd '#{current_release}' && ln -s /sites/shared/index.php index.php"
end
end
before :release, :runcomposer
end
end
的{} current_release变量似乎并没有在这一点上存在(这是奇怪的是,其中的git拉运行,肯定已在/发行/目录中创建(具有相应的时间戳)的目录但我得到“未定义的局部变量或方法‘current_release’”
有没有一种方法可以让我确定这个新版本目录指向它之前的“当前”符号链接?谢谢你这么多提前。