steps.publish 定義

關鍵字 publish 會將 (上傳) 檔案或資料夾,作為其他作業和管線可以使用的管線成品。

關鍵字 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 字串。
步驟的識別碼。 可接受的值:[-_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

另請參閱