steps.download 定义

download 步骤从作为管道资源关联的另一个 Azure Pipeline 下载与当前运行关联的项目。

steps:
- download: string # Required as first property. Specify current, pipeline resource identifier, or none to disable automatic download.
  artifact: string # Artifact name.
  patterns: string # Pattern to download files from artifact.
  condition: string # Evaluate this condition expression to determine whether to run this task.
  continueOnError: boolean # Continue running even on failure?
  displayName: string # Human-readable name for the task.
  target: string | target # Environment in which to run this task.
  enabled: boolean # Run this task when the job runs?
  env: # Variables to map into the process's environment.
    string: string # Name/value pairs
  name: string # ID of the step.
  timeoutInMinutes: string # Time to wait for this task to complete before the server kills it.
  retryCountOnTaskFailure: string # Number of retries if the task fails.
steps:
- download: string # Required as first property. Specify current, pipeline resource identifier, or none to disable automatic download.
  artifact: string # Artifact name.
  patterns: string # Pattern to download files from artifact.
  condition: string # Evaluate this condition expression to determine whether to run this task.
  continueOnError: boolean # Continue running even on failure?
  displayName: string # Human-readable name for the task.
  target: string | target # Environment in which to run this task.
  enabled: boolean # Run this task when the job runs?
  env: # Variables to map into the process's environment.
    string: string # Name/value pairs
  name: string # ID of the step.
  timeoutInMinutes: string # Time to wait for this task to complete before the server kills it.

引用此定义的定义:步骤

性能

download 字符串。 必需为第一个属性。
指定当前、管道资源标识符或 none 以禁用自动下载。

artifact 字符串。
项目名称。

patterns 字符串。
从项目下载文件的模式。

condition 字符串。
计算此条件表达式以确定是否运行此任务。

continueOnError 布尔
即使在失败时继续运行?

displayName 字符串。
任务的人可读名称。

target 目标
运行此任务的环境。

enabled 布尔
作业运行时运行此任务?

env 字符串字典。
变量以映射到进程的环境。

name 字符串。
步骤的 ID。 可接受的值:[-_A-Za-z0-9]*。

timeoutInMinutes 字符串。
等待此任务在服务器终止之前完成的时间。

注释

管道可配置为作业级别超时。 如果作业级别超时间隔在步骤完成之前已过,则运行作业(包括步骤)将终止,即使该步骤配置了更长的 timeoutInMinutes 间隔。 有关详细信息,请参阅 超时

retryCountOnTaskFailure 字符串。
如果任务失败, 重试次数。

注解

download 关键字将项目资源下载到 项目下载位置中指定的文件夹中。

根据引用的项目类型(或项目),download 调用 下载管道项目(对于管道项目(如果管道在 Azure DevOps Services 中运行),下载生成项目(用于生成项目),或 从文件共享(对于文件共享项目)下载项目。

项目下载位置

从当前管道下载到 $(Pipeline.Workspace)/<artifact name>的项目。

将关联的管道资源中的项目下载到 $(Pipeline.Workspace)/<pipeline resource identifier>/<artifact name>

在部署作业中自动下载

从当前管道和关联的管道资源的所有可用项目都会在部署作业中自动下载,并可供部署使用。

若要防止下载,请指定 download: none

例子

steps:
- download: current  # refers to artifacts published by current pipeline
  artifact: WebApp
  patterns: '**/.js'
  displayName: Download artifact WebApp
- download: MyAppA   # downloads artifacts available as part of the pipeline resource specified as MyAppA

另请参阅