0

尽可能简单地说:我们有一个私人 VC 存储库,其中包含我们内部使用的作曲家包列表——[our-bitbucket.com]/comp/

每个包都有自己的仓库。composer.json每个包都在其配置中的 [orgname]/ 下命名空间。

我想要做的是清理这个烂摊子:

  "repositories": [
    {
      "type": "vcs",
      "url": "ssh://git@our-bitbucket.com/comp/package1",
      "options": {
        "ssh2": {
          "username": "git",
          "pubkey_file": ".ssh/pub-key",
          "privkey_file": ".ssh/priv-key"
        }
      }
    },
    {
      "type": "vcs",
      "url": "ssh://git@our-bitbucket.com/comp/package2",
      "options": {
        "ssh2": {
          "username": "git",
          "pubkey_file": ".ssh/pub-key",
          "privkey_file": ".ssh/priv-key"
        }
      }
    },
// [... a dozen more times ...]
],

有没有更好更简单的方法来管理这个?这个 repo 列表变得非常大。我们需要清理它。我不认为有某种方法可以为键添加全局选项?由主机?

4

1 回答 1

0

这是我发现的有助于清理此文件的解决方案:将凭据存储在 中.ssh/config,修改 URL 以匹配配置设置。例如

.ssh/config:

Host our-bitbucket.com
    User git
    IdentityFile /root/.ssh/priv-key
# ----------------------------

satis.json

  "repositories": [
    {"type": "vcs", "url": "ssh://git@our-bitbucket.com/comp/package2"},
    //[... dozen more lines ...]
   ]

它至少使我们不必为每个 repo 定义定义一个 priv/pub 密钥。

于 2019-10-17T15:08:09.420 回答