有没有办法使用私有git存储库与Berkshelf

时间:2014-10-06 10:39:47

标签: git chef berkshelf

我创建了一个名为foo的食谱,并希望与Berkshelf一起使用。

我在Berksfile中写了这样的内容:

cookbook 'foo', git: 'https://bitbucket.org/ironsand/cookbook-foo.git'

然后将cookbook提供给cookbooks目录,但它失败了,错误如下:

berks vendor cookbooks
Resolving cookbook dependencies...
Fetching 'foo' from https://bitbucket.org/ironsand/cookbook-foo.git (at master)
Username for 'https://bitbucket.org':

如何告诉Berkshelf的ssh用户名和密钥? 当然我的用户有权访问git存储库。

1 个答案:

答案 0 :(得分:12)

如果要对git提供程序使用ssh身份验证,则需要使用SSH URL。尝试这样的事情:

cookbook 'foo', git: 'git@bitbucket.org/ironsand/cookbook-foo.git'

这将使用您的SSH密钥进行身份验证。