利用 cap deploy 時會卡在,它不知為何會 ssh 至本機,先前本來正常,但因為換了新的 repository server 後,它就變這樣了。被這個問題困擾好幾天,也試過重設 id_rsa 和把 repository 改到 github,電腦也重裝過,但都會出現這個問題。
麻煩大家了,謝謝。
以下111.111.111.111
是 stage server, 222.222.222.222
是 local
中間有一段它會 ssh 至 local??
require "bundler/capistrano"
server "111.111.111.111", :web, :app, :db, primary: true
set :application, "wed"
set :user, "deployer"
set :deploy_to, "/home/#{user}/apps/#{application}"
set :deploy_via, :remote_cache
set :use_sudo, false
set :scm, "git"
set :repository, "gitosis@stagehost:rb_test.git"
set :branch, "master"
default_run_options[:pty] = true
ssh_options[:forward_agent] = true
after "deploy", "deploy:cleanup"
namespace :deploy do
# ...
end
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote gitosis@stagehost:rb_test.git master"
command finished in 2889ms
* executing "if [ -d /home/deployer/apps/wed/shared/cached-copy ]; then cd /home/deployer/apps/wed/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard a1be4e90bf77800700237adb054961d67efeb974 && git clean -q -d -x -f; else git clone -q gitosis@stagehost:rb_test.git /home/deployer/apps/wed/shared/cached-copy && cd /home/deployer/apps/wed/shared/cached-copy && git checkout -q -b deploy a1be4e90bf77800700237adb054961d67efeb974; fi"
servers: ["111.111.111.111"]
[111.111.111.111] executing command
** [111.111.111.111 :: out] ssh: connect to host 222.222.222.222 port 22: Connection refused
** [111.111.111.111 :: out] fatal: The remote end hung up unexpectedly
command finished in 1584ms
*** [deploy:update_code] rolling back
* executing "rm -rf /home/deployer/apps/wed/releases/20121128103742; true"
servers: ["111.111.111.111"]
[111.111.111.111] executing command
command finished in 403ms
failed: "sh -c 'if [ -d /home/deployer/apps/wed/shared/cached-copy ]; then cd /home/deployer/apps/wed/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard a1be4e90bf77800700237adb054961d67efeb974 && git clean -q -d -x -f; else git clone -q gitosis@stagehost:rb_test.git /home/deployer/apps/wed/shared/cached-copy && cd /home/deployer/apps/wed/shared/cached-copy && git checkout -q -b deploy a1be4e90bf77800700237adb054961d67efeb974; fi'" on 111.111.111.111