current-symlink不是用Capistrano创建的

时间:2015-10-12 10:33:53

标签: capistrano capistrano3

我正在我们的新服务器(Debian 8.2)上测试Capistrano。该过程不会抛出任何错误,但仍无法创建当前符号链接。

这是部署期间stdout的最后一部分:

INFO[f2ae0d8c] Running /usr/bin/env ln -s /var/www/XYZ/releases/20151012102406 /var/www/XYZ/releases/current on YXZ
DEBUG[f2ae0d8c] Command: /usr/bin/env ln -s /var/www/XYZ/releases/20151012102406 /var/www/XYZ/releases/current
INFO[f2ae0d8c] Finished in 0.453 seconds with exit status 0 (successful).
INFO[3e8fb9d3] Running /usr/bin/env mv /var/www/XYZ/releases/current /var/www/XYZ on YXZ
DEBUG[3e8fb9d3] Command: /usr/bin/env mv /var/www/XYZ/releases/current /var/www/XYZ
INFO[3e8fb9d3] Finished in 0.163 seconds with exit status 0 (successful).
DEBUG[9908c456] Running /usr/bin/env ls -xtr /var/www/XYZ/releases on YXZ
DEBUG[9908c456] Command: /usr/bin/env ls -xtr /var/www/XYZ/releases
DEBUG[9908c456]     20151012092018  20151012091607  20151012101321  20151012101911  20151012101707
DEBUG[9908c456]     20151012102406
DEBUG[9908c456] Finished in 0.204 seconds with exit status 0 (successful).
INFOKeeping 5 of 6 deployed releases on YXZ
INFO[a38ee3db] Running /usr/bin/env rm -rf /var/www/XYZ/releases/20151012092018 on YXZ
DEBUG[a38ee3db] Command: /usr/bin/env rm -rf /var/www/XYZ/releases/20151012092018
INFO[a38ee3db] Finished in 0.143 seconds with exit status 0 (successful).
DEBUG[412fe858] Running /usr/bin/env if test ! -d /var/www/XYZ/releases; then echo "Directory does not exist '/var/www/XYZ/releases'" 1>&2; false; fi on YXZ
DEBUG[412fe858] Command: if test ! -d /var/www/XYZ/releases; then echo "Directory does not exist '/var/www/XYZ/releases'" 1>&2; false; fi
DEBUG[412fe858] Finished in 0.192 seconds with exit status 0 (successful).
INFO[3218ed31] Running /usr/bin/env echo "Branch master (at 7f394ab) deployed as release 20151012102406 by Aapo" >> /var/www/XYZ/revisions.log on YXZ
DEBUG[3218ed31] Command: echo "Branch master (at 7f394ab) deployed as release 20151012102406 by Aapo" >> /var/www/XYZ/revisions.log
INFO[3218ed31] Finished in 0.159 seconds with exit status 0 (successful).

如果我使用与Capistrano相同的凭据通过SSH登录YXZ并运行

$ /usr/bin/env ln -s /var/www/XYZ/releases/20151012102406 /var/www/XYZ/releases/current
$ /usr/bin/env mv /var/www/XYZ/releases/current /var/www/XYZ

按照应有的方式创建符号链接。

可能是什么问题?

1 个答案:

答案 0 :(得分:0)

Missing current folder Capistrano Rails 3.2

找到答案

选项

set :use_sudo, false
必须在deploy.rb中设置