整个组织的工件供稿?

问题描述

我的组织中有许多相关项目。当我为任何项目创建工件(nuget 包)时,我想将该包发布到单个组织级提要。

我还希望我的所有项目都使用此提要中的包。

这可能吗?

我目前从我需要引用的项目中引用提要,如下面的 YAML 所示 - 这不起作用。关于我上面提出的第一个问题,引用我需要从本地提要中消费的包的正确方法是什么?

task: NuGetCommand@2
  inputs:
    command: 'push'
    FeedsToUse: 'select'
    vstsFeed: 'Domain.Project/OtherProject@Local'
    publishVstsFeed: 'Domain.Project/OtherProject@Local'

解决方法

首先,我们可以在 Artifacts 中创建一个组织范围的提要:

enter image description here

然后在nuget push任务中指定你的本地包路径和目标提要位置,例如:

enter image description here

- task: NuGetCommand@2
  inputs:
    command: 'push'
    packagesToPush: '..\xx\NuGetPackage\xx.0.0.nupkg'
    nuGetFeedType: 'internal'
    publishVstsFeed: 'xxxx'

使用自托管代理运行管道以将本地包推送到 azure 工件的组织范围提要。

默认池:使用它来注册您设置的 self-hosted agents

pool:
  name: Default