gpt4 book ai didi

azure - 在 Azure YAML 管道中实现 Gates

转载 作者:行者123 更新时间:2023-12-04 11:38:29 25 4
gpt4 key购买 nike

我已经看到并使用过 Azure 发布管道。

我们希望使用基于 YAML 的管道,因为它很容易在 Git 中进行版本控制。有没有办法将管道拆分为阶段,并且每个阶段都有审批者和后续阶段的手动触发。

最佳答案

在 YAML 中,它以不同的方式工作。要使用批准和检查,您需要首先定义环境。拥有环境后,您可以定义批准和检查

enter image description here

重要的是

Approvals and other checks are not defined in the yaml file. Users modifying the pipeline yaml file cannot modify the checks performed before start of a stage. Administrators of resources manage checks using the web interface of Azure Pipelines.

然后在部署作业中您可以选择环境:

jobs:
- deployment: string # name of the deployment job, A-Z, a-z, 0-9, and underscore
displayName: string # friendly name to display in the UI
pool: # see pool schema
name: string
demands: string | [ string ]
dependsOn: string
condition: string
continueOnError: boolean # 'true' if future jobs should run even if this job fails; defaults to 'false'
container: containerReference # container to run this job inside
services: { string: string | container } # container resources to run as a service container
timeoutInMinutes: nonEmptyString # how long to run the job before automatically cancelling
cancelTimeoutInMinutes: nonEmptyString # how much time to give 'run always even if cancelled tasks' before killing them
variables: { string: string } | [ variable | variableReference ]
environment: string # target environment name and optionally a resource-name to record the deployment history; format: <environment-name>.<resource-name>
strategy: [ deployment strategy ] # see deployment strategy schema

您还可以查看此 topic on github

No plans to add approvals in YAML. However, we do plan to support configuring approvals on various resources for example, service connections, variable groups, agent pools etc.

而且没有门(至少目前还没有)。因此,您无法通过批准特定阶段来保护,但可以保护作业中使用的某些资源(例如环境)。

关于azure - 在 Azure YAML 管道中实现 Gates,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61656077/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com