gpt4 book ai didi

ssh - Capifony 部署不能 "git clone"

转载 作者:行者123 更新时间:2023-12-04 21:14:28 25 4
gpt4 key购买 nike

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

我已经成功完成了 cap deploy:setup,现在我需要执行 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 session 并手动调用它时,它会请求 ssh 密码。
当我在 deploy.rb 中填写与 :scm_passphrase 相同的密码时,克隆就成功完成了。
所以看起来 capistrano 无法在我的设置中填写密码。

顺便提一句。 ssh_options[:forward_agent] = 真/假 完全没有有人知道为什么吗?? (我的 ~/.ssh/config 允许代理转发):
Host *hostik.cz
ForwardAgent yes
Host *
ForwardAgent no

我的部署.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

我知道这不是任何原始错误并且我遗漏了一些东西,有人知道吗?

最佳答案

你可以在你的 deploy.rb 中添加这个:

default_run_options[:pty] = true

关于ssh - Capifony 部署不能 "git clone",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7159272/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com