如何使用Gitolite的厨师拉私人git repo [英] How to pull private git repo using chef from gitolite
问题描述
我是新来的厨师。
我可以在我的食谱上使用以下代码克隆/拉github存储库
I am new to using chef. I am able to clone/pull a github repository using the following code on my recipe
git "/var/www/hello_app" do
repository "git://github.com/MyUser/MyProject.git"
reference "master"
action "sync"
user "gituser"
end
我正在尝试从管理我的gitolite的私人git存储库中提取/克隆我的文件这意味着身份验证依赖于sshd。
我已经通过gituser的.ssh / id_rsa文件上的data_bag安装了id_rsa私钥,该用户正在拉/克隆私库。
I am trying to pull/clone my files from a private git repository managed my gitolite which means that authentication relies on sshd. I already have my id_rsa private key installed through a data_bag on gituser's .ssh/id_rsa file , the user who is pulling/cloning the private repo. Pulling/cloning the repository manually works.
我执行的命令是
git clone gitoliteuser@myserver:MyProject.gr
我应该如何修改食谱以便拉出我的私有存储库?
How should I modify my recipe so I can pull my private repository ?
推荐答案
资源的重要部分是存储库
价值。要使用您的gitolite存储库,请将值更改为问题中显示的值:
The important part of the resource is the repository
value. To use your gitolite repo, change the value to the one shown in your question:
git "/var/www/hello_app" do
repository "gitoliteuser@myserver:MyProject.gr"
reference "master"
action "sync"
user "gituser"
end
有关使用git资源的更多详细信息,请参见以下opscode网站: http://docs.opscode.com/resource_git.html
More details about using the git resource can be found on the opscode site here : http://docs.opscode.com/resource_git.html
这篇关于如何使用Gitolite的厨师拉私人git repo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!