1

我有一个项目正在尝试使用 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 并克隆代码。当我 ssh 进入服务器时,命令运行良好。我错过了什么?

这是我的 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
4

1 回答 1

0

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

于 2013-09-27T19:17:18.413 回答