我正在修改功能Capistrano脚本试图加快它,因为我的家庭互联网上传速度是可怕的。我有一个git服务器(不是github)和一个ubuntu dev服务器,当我运行cap部署时,它当前从我的git repo中获取最新的内容,并制作一个本地副本,然后将其上传到我的ubuntu服务器,并重新启动乘客而没有问题。我Capistrano的代码包含...Capistrano部署使用remote_cache - 权限被拒绝
set :deploy_via, :copy
但是,如果我尝试使用这个,而不是...
set :deploy_via, :remote_cache
我得到这个错误...
** transaction: start
* ←[32m2014-03-13 08:43:36 executing `deploy:update_code'←[0m
updating the cached checkout on all servers
←[33mexecuting locally: "git ls-remote ssh://[email protected]/opt/git/hub/app.git master"←[0m
[email protected]'s password:
←[2;37mcommand finished in 6880ms←[0m
* ←[33mexecuting "if [ -d /srv/www/app/shared/cached-copy ]; then cd /srv/www/app/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset
-q --hard efe4a94f5a4f1354edb0f4b516e9ea1d627e5101 && git clean -q -d -x -f; else git clone -q -b master ssh://[email protected]/opt/git/hub/app.git /s
rv/www/app/shared/cached-copy && cd /srv/www/app/shared/cached-copy && git checkout -q -b deploy efe4a94f5a4f1354edb0f4b516e9ea1d627e5101; fi"←[0m
servers: ["12.34.56.78"]
[12.34.56.78] executing command
** ←[31m[12.34.56.78 :: err] Permission denied, please try again.←[0m
** ←[31m[12.34.56.78 :: err] Permission denied, please try again.←[0m
** ←[31m[12.34.56.78 :: err] Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).←[0m
** [12.34.56.78 :: err] fatal: The remote end hung up unexpectedly
它会提示git密码 - [email protected]的密码:
我输入并且进行正常,那么它似乎错误地出现在下一个通信以上。我猜我需要设置一些SSH密钥?再次,这不是托管在github上,repo和dev服务器是我公司服务器上的两个单独的框。本地我运行Windows 7,如果我尝试添加...
set :ssh_options, { :forward_agent => true }
default_run_options[:pty] = true
我得到同样的距离,但这个时候,而不是说自动拒绝的权限,它会提示输入密码gitadmin,我输入正确,它说“没有权限”。
你解决了吗? – jamesc
@jamesw:对不起,我被拉到了我们项目的另一部分,我的脚本脚本与您提供的脚本类似,只是它对于多个环境稍微复杂一些。我试图从部署服务器sshing到git服务器,但它只是在询问密码后挂起。使用您提供的上限脚本给了我同样的问题,我没有时间查看您链接到的railscast。 – HelloWorld
你使用的是什么git服务器? – jamesc