我是否可以将Azure Dev Ops生成定义用于发布管理管道和请求请求,但后者不会触发管道 [英] Can I use an Azure Dev Ops build definition both for a Release Management pipeline and a pull request but with the latter not triggering the pipeline

查看:91
本文介绍了我是否可以将Azure Dev Ops生成定义用于发布管理管道和请求请求,但后者不会触发管道的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简而言之;我们希望使用构建定义来生成用于发布管理的工件并检查拉取请求",但不允许后者触发新的发布.

In short; we want to use a build definition to both generate artifacts for Release Management and checking Pull Requests, but not allow the latter to trigger a new release.

我们在Git Repo上将CI构件定义为CI构建定义,将工件输入发布管理管道.像许多团队一样,我们也设置了拉取请求来保护我们的git master.我们希望在合并合并请求之前重用CI构建以验证拉取"请求,但这样做会自动触发我们的发布管道(将合并绕到主请求).

We have CI build definition on our Git Repo feeding artifacts into a Release Management Pipeline. Like many teams we also have Pull Requests set up to protect our git master. We'd like to reuse our CI build to validate Pull Requests before they are merged in but doing so automatically triggers our release pipeline (bypassing the merge to master).

到目前为止,我们一直在通过复制版本来解决这个问题,但这感觉很笨拙.浏览文档时,没有一种明显的方法可以过滤发布触发器或跳过构建中的发布步骤.我觉得必须在不重复构建的情况下阻止触发器,但是我看不到它!

We've been working round this so far by duplicating builds but that feels clunky. Looking through the documentation there isn't an obvious way to filter a Release Trigger, or skip the publishing step in the build. I feel there must be away of preventing the trigger without duplicating the build but I can't see it!

推荐答案

Azure Dev Ops现在可以实现此行为.您可以修改发布定义的持续部署触发器.两个适用的选项是:

Azure Dev Ops now has a way of achieving this behaviour. You can modify the Continuous Deployment trigger for a Release definition. The two applicable options are:

  • 禁用(轻松命名)拉取请求"触发器
  • 添加分支过滤器,即仅包含主过滤器

请注意另一个答案建议将工件上传条件化,但是出于其他原因,我们仍然需要工件.

Note another answer suggested making the artifact upload conditional, however we still needed the artifact for other reasons.

这篇关于我是否可以将Azure Dev Ops生成定义用于发布管理管道和请求请求,但后者不会触发管道的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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