简体   繁体   English

如何在任何分支上的每次新推送时触发 Azure 管道?

[英]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,以便它自动部署它。

This link will provide additional information 此链接将提供更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将 ACR 与 Azure devops 管道连接,以便每当 ACR azure devops 管道中有新图像时触发 - How to connect ACR with Azure devops pipeline such that whenever there is a new image in ACR azure devops pipeline trigger 在推送到子模块时触发 Azure 管道构建? - Trigger an Azure Pipeline Build on push to a sub-module? 如果管道失败,如何停止触发器 Azure Datafactory - How to stop trigger if pipeline fails Azure Datafactory Azure Devops:如何配置我的管道脚本以触发具有不同 repo 的另一个管道? - Azure Devops: how configure my pipeline script to trigger another pipeline with different repo? 触发 azure 数据工厂管道 - trigger azure data factory pipeline 如何根据提交消息触发 azure devops build pipeline? - How to trigger azure devops build pipeline based on the commit message? 如何使用 jquery 触发 Azure Devops 发布管道 - How to trigger Azure Devops release pipeline using jquery Azure 数据工厂管道故障触发器只执行最后一个管道 - Azure data factory pipeline failure trigger execute only last pipeline Azure 数据工厂,如何将参数从触发器/管道传递到数据源 - Azure Data Factory, how to pass parameters from trigger/pipeline in to data source Azure DevOps 发布管道 - 允许在发布时选择分支 - Azure DevOps Release Pipeline - Allowing branch selection at release time
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM