创建YAML后如何创建构建完成触发器 [英] How to create a Build Completion Trigger after creating YAML

查看:73
本文介绍了创建YAML后如何创建构建完成触发器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在创建了YAML管道之后,有没有人想出如何真正使用经典编辑器"的呢?我有两个YAML管道正在尝试链接,因此管道B成功完成后,管道A就会启动.

根据Microsoft自己的文档:

YAML语法尚不支持构建完成触发器.创建YAML构建管道之后,可以使用经典编辑器来指定构建完成触发器.

如果这是一条蛇,它可能会咬我,但是我迷茫了,如果严格按照YAML创建管道之后,在哪里/如何/如果使用经典编辑器"是可能的.

https://docs.microsoft.com/zh-cn/azure/devops/pipelines/build/triggers?view=azure-devops&s=yaml#build-completion-triggers

解决方案

Micorosft提供了一种新方法-管道资源:

在下面的示例中,我们有两个管道-app-ci(由YAML代码段定义的管道)和security-lib-ci(由管道资源引用的管道).我们希望每次在master分支或任何发行版分支中构建新版本的安全性库时,app-ci管道都可以自动运行.

# this is being defined in app-ci pipeline
resources:
  pipelines:
  - pipeline: securitylib   # Name of the pipeline resource
    source: security-lib-ci # Name of the pipeline referenced by the pipeline resource
    trigger: 
      branches:
      - releases/*
      - master

在此处检查

添加触发器:

Has anyone figured out how to actually 'use the Classic Editor' once you've gone through the effort of creating a YAML pipeline? I have two YAML pipelines I'm trying to link so pipe A kicks off after a successful completion of pipe B.

According to Microsoft's own documentation:

Build completion triggers are not yet supported in YAML syntax. After you create your YAML build pipeline, you can use the classic editor to specify a build completion trigger.

If it was a snake, it probably would have bit me, but I'm at a loss where/how/if "use the classic editor" is possible AFTER creating the pipeline in strictly YAML.

https://docs.microsoft.com/en-us/azure/devops/pipelines/build/triggers?view=azure-devops&tabs=yaml#build-completion-triggers

解决方案

Edit: Micorosft provides a new way - pipeline resource:

In the following example, we have two pipelines - app-ci (the pipeline defined by the YAML snippet) and security-lib-ci (the pipeline referenced by the pipeline resource). We want the app-ci pipeline to run automatically every time a new version of the security library is built in the master branch or any releases branch.

# this is being defined in app-ci pipeline
resources:
  pipelines:
  - pipeline: securitylib   # Name of the pipeline resource
    source: security-lib-ci # Name of the pipeline referenced by the pipeline resource
    trigger: 
      branches:
      - releases/*
      - master

Check here more info.


Old answer:

When you edit the YAML click on Triggers:

There add the trigger:

这篇关于创建YAML后如何创建构建完成触发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆