Azue Devops 手动验证任务

问题描述 投票:0回答:1

在我的 Azure DevOps 中,找不到 ManualValidation 任务!

我确实在扩展程序中进行了搜索,但似乎这不是正常的扩展程序,即使存在的ManualIntervention,也不作为扩展程序存在。

尝试时我得到了不同的错误,即“

The given key release.releaseId is not found in the dictionary

下面是我使用的yaml。

jobs:
- job: doSomething
  displayName: Do Something
  steps: 
  - script: echo Hello World!
    displayName: 'run a one line script'

- job: waitForvalidation
  displayName: wait For External Validation
  dependsOn: doSomething
  pool: server
  timeoutInMinutes: 15
  steps: 
  - task: ManualIntervention@8
    inputs:
      instructions: "please validate"
      emailRecipients: 'my-mail'
      onTimeout: reject
- job: doSomethingAfterValidation
  displayName: Do Something After Validation
  dependsOn: waitForvalidation
  steps: 
  - script: echo Deploy to prod!
    displayName: 'run a one line script'
azure-devops azure-pipelines
1个回答
0
投票

手动验证任务和手动干预任务不是扩展,而是任务。

手动干预任务中注意到

此任务旨在用于经典发布管道。有关 YAML 的用法,请参阅手动验证任务

因此您可以在 yaml 中使用手动验证任务。

Yaml 示例:

jobs:
- job: doSomething
  displayName: Do Something
  steps: 
  - script: echo Hello World!
    displayName: 'run a one line script'

- job: waitForValidation
  displayName: Wait for external validation
  pool: server
  timeoutInMinutes: 4320 # job times out in 3 days
  steps:
  - task: ManualValidation@0
    timeoutInMinutes: 1440 # task times out in 1 day
    inputs:
      notifyUsers: |
        [email protected]
        [email protected]
      instructions: 'Please validate the build configuration and resume'
      onTimeout: 'resume'
- job: doSomethingAfterValidation
  displayName: Do Something After Validation
  dependsOn: waitForvalidation
  steps: 
  - script: echo Deploy to prod!
    displayName: 'run a one line script'

测试结果:

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.