[英]How to trigger Azure Pipeline on every new push on any branch?
My current implementation of Azure pipelines is to trigger only when a pull request is made to Develop branch.我当前对 Azure 管道的实现是仅在向 Develop 分支发出拉取请求时触发。 But, I want to run the pipeline on every new push on any branch.
但是,我想在任何分支上的每个新推送上运行管道。 How to trigger that?
如何触发?
My current implementation of the Azure YAML file我目前执行的Azure YAML文件
trigger:
- none
pr:
- branches:
include:
- dev
and below that steps are configured.并在下面配置步骤。
You need to specify the trigger something like this.您需要像这样指定触发器。 So for example, if there is anything pushed in
dev
branch a build will get triggered.因此,例如,如果在
dev
分支中推送了任何内容,则会触发构建。 Ref 参考
trigger:
- dev
or to be more explicit:或更明确地说:
trigger:
branches:
include:
- dev
- another-branch
If no triggers are specified it will by default run for all branches.如果没有指定触发器,它将默认为所有分支运行。 It can be explicitly defined as:
它可以明确定义为:
trigger:
branches:
include:
- '*'
In my case, using Azure DevOps, I have this on my.yaml file:在我的例子中,使用 Azure DevOps,我在 my.yaml 文件中有这个:
trigger:
- '*'
pool:
vmImage: 'windows-latest'
So, it gets triggered no matter to which branch I'm pushing to.因此,无论我推送到哪个分支,它都会被触发。 I hope it might help.
我希望它能有所帮助。
Note: the pool part is not relevant;注: pool部分不相关; I just added to give more context.
我只是添加以提供更多上下文。
If you have git and a repo created in your project, you can easily connect git to azure dev ops.如果您有 git 和在您的项目中创建的 repo,您可以轻松地将 git 连接到 azure 开发操作。 So let's say you want to deploy every push you give to the master branch of your repo.
因此,假设您想将您提供的每个推送部署到您的存储库的主分支。 You can connect your master branch to the azure DevOps so it deploys it automatically.
您可以将您的主分支连接到 azure DevOps,以便它自动部署它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.