resources.packages.package 定義

您可以使用 NuGet 和 npm GitHub 套件作為 YAML 管線中的資源。 指定封裝資源時,請將封裝設定為 NuGetnpm

packages:
- package: string # Required as first property. Alias of package artifact.
  type: string # Required. Type of the package. Ex - NuGet, NPM etc.
  connection: string # Required. Name of the connection. This connection will be used for all the communication related to this artifact.
  name: string # Required. Name of the package.
  version: string
  tag: string
  trigger: none | true # Trigger a new pipeline run when a new version of this package is available.

參考此定義的定義: resources.packages

屬性

package 字串。 做為第一個屬性的必要專案。
封裝成品的別名。 可接受的值:[-_A-Za-z0-9]*。

type 字串。 必要。
封裝的類型。 例如 - NuGet、NPM 等。

connection 字串。 必要。
連線的名稱。 此連線將用於與這個成品相關的所有通訊。

name 字串。 必要。
封裝的名稱。

version 字串。

tag 字串。

trigger 字串。
當這個套件的新版本可供使用時,觸發新的管線執行。 none |真。

範例

在此範例中,有名為 的 GitHub 服務連線 ,名為 pat-contosocontoso GitHub npm 套件。 深入瞭解 GitHub 套件

resources:
  packages:
    - package: contoso
      type: npm
      connection: pat-contoso
      name: yourname/contoso 
      version: 7.130.88 
      trigger: true

pool:
  vmImage: ubuntu-latest

steps:
- getPackage: contoso 

另請參閱