Capifony部署不能“git clone”

时间:2011-08-23 10:00:52

标签: ssh capistrano ssh-keys

我在Capistrano v2.8.0上通过非常新鲜的方式部署有问题 - 这是我的第一次capistrano / capifony部署。

我已经成功完成了帽子部署:设置,现在我需要执行cap deploy:cold。 SSH通信运行良好,但由于ssh权限,它无法执行git clone命令:

  * executing "git clone -q git@github.com:palmic/www.myproject.com.git /home/palmic/web/hostik.cz/palmic/releases/20110823122821 && cd /home/palmic/web/hostik.cz/palmic/releases/20110823122821 && git checkout -q -b deploy 7407672c0a59ad631ea2f1f1d71fb15c2f68ac30 && (echo 7407672c0a59ad631ea2f1f1d71fb15c2f68ac30 > /home/palmic/web/hostik.cz/palmic/releases/20110823122821/REVISION)"
    servers: ["hostik.cz"]
    [hostik.cz] executing command
 ** [hostik.cz :: err] Permission denied (publickey).
 ** fatal: The remote end hung up unexpectedly
    command finished in 3123ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /home/palmic/web/hostik.cz/palmic/releases/20110823122821; true"
    servers: ["hostik.cz"]
    [hostik.cz] executing command
    command finished in 164ms

当我登录ssh会话并调用此manualy时,它请求ssh密码。 当我填写我喜欢的相同密码:deploy.rb中的scm_passphrase,然后克隆成功完成。 所以看起来capistrano无法在我的设置中填写密码。

顺便说一句。 ssh_options [:forward_agent] = true / false 完全没有人知道为什么?(我在〜/ .ssh / config中允许代理转发):

Host *hostik.cz
  ForwardAgent yes
Host *
  ForwardAgent no

我的deploy.rb:

set :application, "app"
set :domain,      "hostname"
set :deploy_to,   "remotepath"
set :use_sudo, false

set :repository,  "git@github.com:palmic/myproject.git"
set :scm,         :git
set :user, "my remote username"
set :scm_passphrase, "my ssh passphrase on remote host"
set :branch, "git project deploy branchname"
set :scm_verbose, true

role :web,        domain                         # Your HTTP server, Apache/etc
role :app,        domain                         # This may be the same as your `Web` server
role :db,         domain, :primary => true       # This is where Rails migrations will run


set  :keep_releases,  3


ssh_options[:forward_agent] = true

我知道这不是任何原始的错误,我错过了什么,有人知道吗?

1 个答案:

答案 0 :(得分:7)

您可以在deploy.rb中添加:

default_run_options[:pty] = true