【问题标题】:Using multiple private repos in same vc location在同一个 vc 位置使用多个私有仓库
【发布时间】:2019-10-16 19:27:35
【问题描述】:

尽可能简单地说:我们有一个私人 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 列表变得非常大。我们需要清理它。我不认为有某种方法可以为键添加全局选项?按主机?

【问题讨论】:

    标签: composer-php satis


    【解决方案1】:

    这是我发现的一个有助于清理此文件的解决方案:将凭据存储在 .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 键。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-09-23
      • 1970-01-01
      • 2015-02-10
      • 2020-06-17
      • 1970-01-01
      • 2012-08-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多