【问题标题】:Is there a way to use private git repository with Berkshelf有没有办法在 Berkshelf 中使用私有 git 存储库
【发布时间】:2014-10-07 00:36:46
【问题描述】:

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

我在Berksfile这样写:

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

然后将食谱供应到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 存储库。

【问题讨论】:

  • 如果您想使用“ssh 用户名和密钥”,您是否尝试过指定SSH URL
  • 我想知道如何用berks命令指定ssh URL。
  • 来自 bershelf 文档:“如果您需要引用私有 Github 存储库,那么您应该使用 :git 位置和 ssh 协议。”所以请参阅 SSH URL 中的 @Joe 链接...
  • 哦,现在我明白@Joe 的意思了,谢谢!

标签: git chef-infra berkshelf


【解决方案1】:

如果你想对你的 git 提供者使用 ssh 身份验证,你需要使用一个 SSH URL。试试这样的:

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

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

【讨论】:

    猜你喜欢
    • 2020-06-18
    • 1970-01-01
    • 2022-07-06
    • 1970-01-01
    • 2011-07-03
    • 2015-03-19
    • 2012-02-22
    • 2010-12-17
    相关资源
    最近更新 更多