【问题标题】:How to restore packages from Artifactory using YAML如何使用 YAML 从 Artifactory 恢复包
【发布时间】:2019-02-20 17:11:59
【问题描述】:

指南here给出了下面的示例代码:

- task: DotNetCoreCLI@2
  inputs:
    command: restore
    projects: '**/*.csproj'
    feedsToUse: config
    nugetConfigPath: NuGet.config    # Relative to root of the repository
    externalFeedCredentials: <Name of the NuGet service connection>

但我很难知道需要什么来代替 &lt;Name of the NuGet service connection&gt; 甚至 NuGet.config

Artifactory 上的指南没有使用 YAML,甚至没有提到它,所以我不知道它是否可能。

我的问题:以上是否可能,如果可以,我应该在上面的脚本中包含什么?

【问题讨论】:

    标签: azure-devops artifactory


    【解决方案1】:

    &lt;Name of the NuGet service connection&gt; 正是它所说的。在您的项目中创建一个指向 NuGet 提要的service connection,然后在那里按名称引用它。

    【讨论】:

    • 当您知道如何操作时很容易...谢谢。
    • @Percy 再次告诉您问题所在。您创建了错误的 Feed 类型。它需要一个外部 NuGet 源服务连接,而不是 Artifactory 服务连接。如果您在市场上安装了某种 Artifactory 扩展,则可能有您可以使用的特定于 Artifactory 的构建步骤。
    • 完美答案。您可以在管道 > 服务连接下的项目设置中找到服务连接。您将希望服务连接类型为“NuGet”(而不是“Artifactory”)。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多