我在同一个 VPS 服务器上构建了 gitosis 服务器和 stage 服务器。在我的本地机器或阶段服务器中从 gitosis 克隆存储库运行良好。但是cap deploy
在本地机器上总是要求我输入如下密码,我不知道是哪个密码,我尝试了每个密码都不起作用。
而且我知道可以使用 复制本地存储库deploy_via: copy
,但我更喜欢为其他项目构建一个 gitosis 服务器。
有任何想法吗?谢谢。
环境
gitosis 和阶段服务器 ip:(106.187.xxx.xxx
出于安全原因屏蔽一些数字)
日志
* executing `deploy'
triggering before callbacks for `deploy'
* executing `check:revision'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote gitosis@106.187.xxx.xxx:foo_project.git master"
command finished in 1105ms
* executing "if [ -d /home/deployer/apps/railsapp/shared/cached-copy ]; then cd /home/deployer/apps/railsapp/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 07827de89355c5366c4511ee22fdd9c68a31b0be && git clean -q -d -x -f; else git clone -q gitosis@106.187.xxx.xxx:foo_project.git /home/deployer/apps/railsapp/shared/cached-copy && cd /home/deployer/apps/railsapp/shared/cached-copy && git checkout -q -b deploy 07827de89355c5366c4511ee22fdd9c68a31b0be; fi"
servers: ["106.187.xxx.xxx"]
[106.187.xxx.xxx] executing command
** [106.187.xxx.xxx :: out] Password:
Password:
** [106.187.xxx.xxx :: out]
** [106.187.xxx.xxx :: out] Password:
Password:
** [106.187.xxx.xxx :: out]
** [106.187.xxx.xxx :: out] Password:
Password:
** [106.187.xxx.xxx :: out]
** [106.187.xxx.xxx :: out] Permission denied (publickey,keyboard-interactive).
** [106.187.xxx.xxx :: out] fatal: The remote end hung up unexpectedly
部署.rb
server "106.187.xxx.xxx", :web, :app, :db, primary: true
set :application, "railsapp"
set :user, "deployer"
set :local_user, "joshchang"
set :deploy_to, "/home/#{user}/apps/#{application}"
set :use_sudo, false
set :rails_env, "stage"
set :scm, "git"
set :repository, "gitosis@106.187.xxx.xxx:foo_project.git"
set :deploy_via, :remote_cache
set :branch, "master"
default_run_options[:pty] = true
ssh_options[:forward_agent] = true