我是卡皮斯特拉诺(第3.2.1节)的绝对新手,所以请原谅我,错误,无用.我正在部署一个PHP应用程序并希望在deploy:symlink:release任务之前运行composer install(仅在不运行回滚时)
我无法访问新创建的发布目录,因为我需要它才能进入它并运行composer(并运行其他一些项目).我现在有;
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 pull的目录肯定是在/ releases /目录中创建的(带有适当的时间戳)但是我得到'未定义的局部变量或方法"current_release"'
有没有办法在'当前'符号链接指向它之前确定这个新版本目录?非常感谢你提前.