Capistrano部署无法复制文件

时间:2013-06-03 13:16:18

标签: php capistrano capifony

我有一个项目,我正在尝试使用capistrano进行部署。这是PHP,所以我们使用capifony。问题是源代码永远不会签出并保存到服务器。以下是部署输出的一部分:

executing locally: "git ls-remote git@github.com:repo/app-widget.git master"
command finished in 3403ms
* executing "git clone -q git@github.com:repo/app-widget.git /u/apps/app/releases/20130603130402 && cd /u/apps/app/releases/20130603130402 && git checkout -q -b deploy b86a5c027b1b2a245aa90e18ccd0211fa72e3466 && (echo b86a5c027b1b2a245aa90e18ccd0211fa72e3466 > /u/apps/app/releases/20130603130402/REVISION)"
servers: ["1.2.3.4 "]
[1.2.3.4 ] executing command
command finished in 1820ms
<snip>
* executing "ln -nfs /u/apps/app/shared/application/commons/app/logs /u/apps/app/releases/20130603130402/application/commons/app/logs"
servers: ["1.2.3.4 "]
[1.2.3.4 ] executing command
*** [err :: 1.2.3.4] ln:
*** [err :: 1.2.3.4] failed to create symbolic link `/u/apps/app/releases/20130603130402/application/commons/app/logs'
*** [err :: 1.2.3.4] : No such file or directory

我检查了服务器,/ u / apps / app / releases中没有任何内容。我确保运行作业的ubuntu用户拥有版本目录。我还确保ubuntu用户可以访问repo并克隆代码。当我进入服务器时,命令运行正常。我错过了什么?

这是我的deploy.rb的相关部分:

set :ssh_options, { :forward_agent => false }
set :use_sudo, false
set :user, 'ubuntu'
set :scm, :git
set :repository,  "git@github.com:repo/app-widget.git"

set :branch, fetch(:version, `git tag`.split("\n").last)
set :model_manager, "doctrine"

set :keep_releases, 2
#set :deploy_via, :remote_cache

set :webserver_user, "www-data"
set :permission_method, :acl
set :use_set_permissions, false
set :interactive_mode, true
logger.level = Logger::MAX_LEVEL

task :testing do
  set :user, "ubuntu"

  set :domain, "1.2.3.4"

  role :app, domain
  role :web, domain
  role :db, domain, :primary => true

  set :env, "test"
end

1 个答案:

答案 0 :(得分:0)

不确定这是否在deploy.rb的非相关部分,但您需要设置deploy_to。我认为如果没有指定deploy_to目录,/ u / apps是默认的。