steps.download 定义

download 步骤将下载与当前运行关联的项目,或者从另一个关联为管道资源的 Azure 管道中下载项目。

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.
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.
  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 字符串。 作为第一个属性是必需的。
指定当前、管道资源标识符或无以禁用自动下载。

artifact 字符串。
项目名称。

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

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

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

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

targettarget
运行此任务的环境。

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

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

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

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

注意

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

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

注解

关键字 (keyword) 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

另请参阅