简体   繁体   中英

Capistrano deployment can't copy files

I have a project I'm trying to deploy with capistrano. It's PHP, so we're using capifony. The problem is that the source code is never checked out and saved to the server. Here's part of the output from a deploy:

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

I checked the server, and there is nothing in /u/apps/app/releases. I made sure the ubuntu user, who the job is run under, owns the releases directory. I also made sure the ubuntu user can access the repo and clone the code. When I ssh into the server the commands run fine. What am I missing?

Here's the relevant part of my 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

Not sure if this is in the non-relevant part of your deploy.rb, but you need to set deploy_to. I think /u/apps is the default if no deploy_to directory is specified.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM