【问题标题】:How to pull private git repo using chef from gitolite如何使用来自 gitolite 的厨师拉私人 git 仓库
【发布时间】:2013-09-10 08:23:04
【问题描述】:

我是新来使用厨师。 我可以在我的食谱中使用以下代码克隆/拉取一个 github 存储库

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 私钥,该用户正在提取/克隆私人仓库。手动拉取/克隆存储库。

我执行的命令是

git clone gitoliteuser@myserver:MyProject.gr

我应该如何修改我的配方,以便我可以提取我的私人存储库?

【问题讨论】:

  • 请不要忘记将答案标记为正确! :) 看起来你评论说格雷厄姆发布了正确的答案 - 你能把它标记为正确吗?

标签: git chef-infra


【解决方案1】:

资源的重要部分是repository 值。要使用您的 gitolite 存储库,请将值更改为您的问题中显示的值:

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

【讨论】:

  • 谢谢。我终于想通了,但我现在看到你回复了。所以我要感谢你只是发帖。
  • 如果你觉得这个答案有用,请采纳,让别人受益?干杯
猜你喜欢
  • 1970-01-01
  • 2018-06-16
  • 1970-01-01
  • 2021-02-05
  • 1970-01-01
  • 1970-01-01
  • 2015-04-08
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多