如何在同一台服务器上从我的gitolite repo部署我的网站?

时间:2012-02-05 16:54:56

标签: git ubuntu gitolite vlad-deployer

我正在使用Sinatra,Vlad the Deployer和Gitolite尝试将测试站点部署到我的服务器。我的gitolite安装工作正常,管理/创建repos,推送和克隆等,但当我尝试通过Vlad部署到我的服务器时,我不断收到权限被拒绝

$ rake vlad:update

返回

rake aborted!
execution failed with status 1:ssh mysite.com unmask 02 && cd ..........

我的vlad deploy.rb文件看起来像这样

#deploy.rb

set :application, "mysite.com/sample-site"
set :user,        "me"
set :repository, "git@mysite.com:sample-site.git"
set :domain, "mysite.com"
set :deploy_to, "~/sites/#{application}"

我认为正在发生的事情是gitolite用户如何命名为'git',它试图从它所在的服务器克隆repo但没有适当的权限。我想我可能会为用户git创建一个新的rsa对,然后只需将它添加到我的gitolite keydir中的用户列表中,但是使用gitolite安装,你不能再使用“PTY 0 error”ssh了,这似乎是正常。

当我尝试将repos从服务器克隆到自身,即git clone作为我从服务器上的repo,我会被要求输入git @ mysite的密码,所以我试图复制我的客户端id_rsa和id_rsa。 pub到我的服务器然后在我的客户端gitolite-admin.conf中添加@ mysite作为另一个用户。当我推送该更新时,它一直给我一个错误

Writing objects: 100% (4/4), 378 bytes, done.
Total 4 (delta 2), reused 0 (delta 0)
remote: WARNING: a pubkey file can only have one line (key); ignoring jon@mysite.com.pub
remote:          Perhaps you're using a key in a different format (like putty/plink)?
remote:          If so, please convert it to openssh format using 'ssh-keygen -i'.
remote:          If you want to add multiple public keys for a single user, use
remote:          "user@host.pub" file names.  See the "one user, many keys"
remote:          section in doc/3-faq-tips-etc.mkd for details.
remote: 
remote:         ***** WARNING *****
remote:         the following users (pubkey files in parens) do not appear in any access rules:
remote: jon@mysite.com(jon@mysite.com.pub)
remote: 
remote:         ***** WARNING *****
remote:         the following users have no pubkeys:
remote: jon@mysite

我最初尝试使用me@site.com.pub添加我的新服务器用户,但后来认为切换到me@mysite.pub更清洁,可能会解决一些问题。即使在删除和/或重命名密钥本身中的所有内容以及密钥的名称为me@mysite.pub

之后,我也有了一些工件。

所以我现在所处的位置是我可以在登录时从服务器克隆,但每次都要求输入我的id_rsa密码​​。当我输入它,我可以下载。我的rake vlad:更新虽然得到了与我开始时相同的错误.....

感谢您的帮助

1 个答案:

答案 0 :(得分:0)

我不能特意评论部署者,但你不应该对git帐户的密钥做任何事情。您需要为正在运行该过程的用户设置密钥。这似乎是用户'?因此,您需要为该计算机上的用户生成rsa并专门添加pub密钥。

您在问题结尾处看到的错误是您的keydir中的gitolite与配置文件中的条目之间的密钥不匹配。 keydir中的所有内容都需要以.pub结尾,并在conf中引用它而不使用.pub