onSuccessOrFailureHook 定义

用于运行回滚操作或清理的步骤。

onSuccessOrFailureHook:
  failure: # Runs on failure of any step.
    steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
    pool: string | pool # Pool where post on failure steps will run.
  success: # Runs on success of all of the steps.
    steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
    pool: string | pool # Pool where on success steps will run.

注意

此定义是一个支持性定义,不适合直接在管道中使用。 本文提供此支持类型的 YAML 语法,但未显示用法示例。 有关使用此类型支持的定义的详细信息,请参阅以下定义链接。

引用此定义的定义: jobs.deployment.strategy.runOncejobs.deployment.strategy.rollingjobs.deployment.strategy.canary

属性

failureonFailureHook
在任何步骤失败时运行。

successonSuccessHook
在所有步骤成功后运行。