简体   繁体   English

如何使用gitolite厨师拉私人git repo

[英]How to pull private git repo using chef from gitolite

I am new to using chef. 我是新手使用厨师。 I am able to clone/pull a github repository using the following code on my recipe 我能够使用我的食谱上的以下代码克隆/拉取github存储库

git "/var/www/hello_app" do
  repository "git://github.com/MyUser/MyProject.git"
  reference "master"
  action "sync"
  user "gituser"
end

I am trying to pull/clone my files from a private git repository managed my gitolite which means that authentication relies on sshd. 我试图从私有git存储库拉取/克隆我的文件管理我的gitolite,这意味着身份验证依赖于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. 我已经通过gituser的.ssh / id_rsa文件中的data_bag安装了我的id_rsa私钥,该文件正在拉动/克隆私人仓库。 Pulling/cloning the repository manually works. 手动拉取/克隆存储库的工作原理。

The command I execute is 我执行的命令是

git clone gitoliteuser@myserver:MyProject.gr

How should I modify my recipe so I can pull my private repository ? 我应该如何修改我的食谱,以便拉出我的私人存储库?

The important part of the resource is the repository value. 资源的重要部分是repository值。 To use your gitolite repo, change the value to the one shown in your question: 要使用您的gitolite repo,请将值更改为您问题中显示的值:

git "/var/www/hello_app" do
  repository "gitoliteuser@myserver:MyProject.gr"
  reference "master"
  action "sync"
  user "gituser"
end

More details about using the git resource can be found on the opscode site here : http://docs.opscode.com/resource_git.html 有关使用git资源的更多详细信息,请访问opscode网站: http ://docs.opscode.com/resource_git.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM