steps.publish definition

关键字 (keyword) publish 发布 (上传) 文件或文件夹作为其他作业和管道可以使用的管道项目。

关键字 (keyword) publish 发布 (上传) 文件或文件夹作为其他作业和管道可以使用的管道项目。

重要

publish仅 Azure DevOps Services 支持此步骤。 如果在 Azure DevOps Server 上使用它,则如果使用的是 Azure DevOps Server,则会收到类似于Pipeline Artifact Task is not supported in on-premises. Please use Build Artifact Task instead.“使用发布生成项目”的错误消息。

steps:
- publish: string # Required as first property. The publish step is a shortcut for the PublishPipelineArtifact@1 task. The task publishes (uploads) a file or folder as a pipeline artifact that other jobs and pipelines can consume.
  artifact: string # Artifact name.
  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:
- publish: string # Required as first property. The publish step is a shortcut for the PublishPipelineArtifact@1 task. The task publishes (uploads) a file or folder as a pipeline artifact that other jobs and pipelines can consume.
  artifact: string # Artifact name.
  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:
- publish: string # Required as first property. The publish step is a shortcut for the PublishPipelineArtifact@1 task. The task publishes (uploads) a file or folder as a pipeline artifact that other jobs and pipelines can consume.
  artifact: string # Artifact name.
  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.

引用此定义的定义: 步骤

属性

publish 字符串。 作为第一个属性是必需的。
发布步骤是PublishPipelineArtifact@1任务的快捷方式。 任务将文件或文件夹作为其他作业和管道可以使用的管道工件进行发布(上传)。

artifact 字符串。
项目名称。

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

continueOnError布尔值
即使发生故障,仍要继续运行?

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

targettarget
要在其中运行此任务的环境。

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

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

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

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

注意

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

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

注解

publish 关键字是“发布管道工件”任务的快捷方式。

重要

publish仅 Azure DevOps Services 支持此步骤。 如果在 Azure DevOps Server 上使用它,则如果使用的是 Azure DevOps Server,则会收到类似于Pipeline Artifact Task is not supported in on-premises. Please use Build Artifact Task instead.“使用发布生成项目”的错误消息。

详细了解发布工件

示例

steps:
- publish: $(Build.SourcesDirectory)/build
  artifact: WebApp
  displayName: Publish artifact WebApp

另请参阅