for*_*dya 5 azure azure-devops
我见过并使用过 Azure 发布管道。
我们希望使用基于 YAML 的管道,因为它很容易在 Git 中进行版本控制。有没有办法在阶段中拆分管道,每个阶段都有后续阶段的批准者和手动触发器。
在 YAML 中,它以不同的方式工作。要使用批准和检查,您需要先定义环境。一旦你有了一个环境,你就可以定义approvals and checks.
重要的是
yaml 文件中未定义批准和其他检查。修改管道 yaml 文件的用户无法修改在阶段开始之前执行的检查。资源管理员使用 Azure Pipelines 的 Web 界面管理检查。
然后在部署作业中,您可以选择环境:
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
Run Code Online (Sandbox Code Playgroud)
您也可以在 github 上查看此主题
没有计划在 YAML 中添加批准。但是,我们确实计划支持在各种资源上配置批准,例如服务连接、变量组、代理池等。
并且没有门(至少现在是)。因此,您无法通过批准特定阶段进行保护,但您可以保护作业中使用的某些资源(如环境)。
| 归档时间: |
|
| 查看次数: |
3064 次 |
| 最近记录: |