Azure DevOps:除主分支之外的所有分支的管道
我有一个带有两个管道的网站项目
1.- PROD 管道,它在每次主分支推送时触发。这将构建网站、部署网站并向整个公司发送电子邮件,通知新版本。到目前为止,这工作得很好 ✅
2.- DEV pipeline:应该在推送到任何非主分支时触发。构建站点,将站点部署到 DEV 阶段并向提交的作者发送电子邮件。
按照文档,此触发器配置应触发除主分支之外的所有分支上的 DEV 管道。
trigger:
branches:
exclude:
- master
include:
- '*'
但是,如果我随后尝试在非主分支的任何分支中运行管道,则会收到以下错误:遇到错误:无法找到此分支/标签的有效管道 YAML 文件
如何设置管道,以便它被除主分支之外的所有分支触发?
预先感谢您的帮助!
D
I have a website project with two pipelines
1.- PROD pipeline, which is triggered on every master branch push. This builds the site, deploys it and sends an email to the whole company informing about the new version. This works perfectly so far ✅
2.- DEV pipeline: should be triggered on a push to ANY branch that is not master. Builds the site, deploys the site to a DEV stage and sends an email to the author of the commit.
Following the docs, this trigger configuration should trigger the DEV pipeline on all branches but master.
trigger:
branches:
exclude:
- master
include:
- '*'
However, if I then try run the pipeline in any branch that is not master, I get the following error: Encountered error(s): Could not find valid pipeline YAML file for this branch/tag
How can I setup the pipeline, so that it gets triggered by all branches but the master branch?
Thanks in advance for your help!
D
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须在要触发的每个分支中都有yaml文件,而不能仅仅将其放在主分支中,并期望它在另一个分支上触发。
You have to have the YAML file in every branch you want it to trigger for, you cannot just have it in the master branch and expect it to trigger on another branch.