为什么 capistrano 3 链接文件在 dry 运行 上失败?

Why capistrano 3 linked files aways fails on dry run?

当我 运行 bundle exec cap production deploy:check:linked_files 我成功了,但是如果我添加 --dry-运行 测试,它就会失败。

查看输出:

bundle exec cap production deploy:check:linked_files

DEBUG [c593caa5] Running /usr/bin/env [ -f /home/app/www/shared/config/database.yml ] as app@xxx.xxx.xxx.xxx
DEBUG [c593caa5] Command: [ -f /home/app/www/shared/config/database.yml ]
DEBUG [c593caa5] Finished in 3.206 seconds with exit status 0 (successful).
DEBUG [9619277e] Running /usr/bin/env [ -f /home/app/www/shared/config/mongoid.yml ] as app@xxx.xxx.xxx.xxx
DEBUG [9619277e] Command: [ -f /home/app/www/shared/config/mongoid.yml ]
DEBUG [9619277e] Finished in 0.304 seconds with exit status 0 (successful).

并使用 --dry-运行:

bundle exec cap production deploy:check:linked_files --dry-run

DEBUG [26483ac3] Running /usr/bin/env [ -f /home/app/www/shared/config/database.yml ] as app@xxx.xxx.xxx.xxx
DEBUG [26483ac3] Command: [ -f /home/app/www/shared/config/database.yml ]
ERROR linked file /home/app/www/shared/config/database.yml does not exist on xxx.xxx.xxx.xxx

这是预期的还是某种错误?

由于 --dry-run 在 Capistrano 中的工作方式,这是一个错误。在干 运行 期间,所有 test 命令 return false。所以Capistrano认为链接的文件不存在,就放弃了。

https://github.com/capistrano/capistrano/issues/1565