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

iro*_*and 6 git chef-infra berkshelf

我创建了一个名为的食谱foo,并希望与之配合使用Berkshelf.

我写的是这样的Berksfile:

cookbook 'foo', git: 'https://bitbucket.org/ironsand/cookbook-foo.git'
Run Code Online (Sandbox Code Playgroud)

然后将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':
Run Code Online (Sandbox Code Playgroud)

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

Tej*_*don 13

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

cookbook 'foo', git: 'git@bitbucket.org/ironsand/cookbook-foo.git'
Run Code Online (Sandbox Code Playgroud)

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