douzhui8531 2013-06-03 13:16
浏览 53

Capistrano部署无法复制文件

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("
").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条回答 默认 最新

  • dongliu8559 2013-09-27 19:17
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题