Capifony 部署无法“git clone”
我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将其添加到deploy.rb中:
You could add this in your deploy.rb: