Capifony 部署无法“git clone”

发布于 2024-12-01 02:30:49 字数 2354 浏览 0 评论 0原文

我在 Capistrano v2.8.0 上通过非常新鲜的 capifony 进行部署时遇到问题 - 这是我的第一个 capistrano/capifony 部署。

我已成功完成 cap deploy:setup,现在我需要执行 cap deploy:cold。 SSH 通信工作正常,但由于 ssh 权限,它无法执行 git clone 命令:

  * executing "git clone -q [email protected]: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 会话并手动调用此命令时,它会请求 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,  "[email protected]: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

我知道它不是任何原始错误并且我缺少一些东西,有人知道吗?

I have problem to deploy via very fresh capifony up on Capistrano v2.8.0 - it's my first capistrano/capifony deploy.

I have successfully done cap deploy:setup and now i need to execute cap deploy:cold.
SSH communication works well but it cannot execute git clone command because of ssh permissions:

  * executing "git clone -q [email protected]: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

When i login into ssh session and call this manualy it request ssh passphrase.
When i fill up the same passphrase which i have like :scm_passphrase in deploy.rb, then clone is successfully done.
So it looks like capistrano cannot fill up passphrase on my setup.

BTW. ssh_options[:forward_agent] = true/false does totaly nothing does anybody knows why?? (i have agent forwarding allowed in my ~/.ssh/config):

Host *hostik.cz
  ForwardAgent yes
Host *
  ForwardAgent no

my deploy.rb:

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

set :repository,  "[email protected]: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

I know it's not any original bug and iam missing something, does anybody know?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

横笛休吹塞上声 2024-12-08 02:30:49

您可以将其添加到deploy.rb中:

default_run_options[:pty] = true

You could add this in your deploy.rb:

default_run_options[:pty] = true
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文