DevOps构建管道 - 通过PR触发特定阶段
Azure Devops,Yaml管道,通过PR触发特定阶段。
是否可以通过不同的PRS完成触发特定阶段(不是通过创建构建或PR,然后触发另一个构建管道)? 下面的示例,如果我更新we.json
并将PR合并到我的Azure存储库中,我希望PR触发我的管道,尤其是阶段Deploy> Deployand-We-We
,以及<强>不触发 deploy-ne
。
trigger:
branches:
include:
- main
paths:
include:
- arm/we.json
- arm/ne.json
pool:
vmImage: ubuntu-latest
stages:
- stage: we
condition: xxx
jobs:
- job: Deploy-we
steps:
- task: AzureResourceManagerTemplateDeployment@3
inputs:
deploymentScope: 'Resource Group'
azureResourceManagerConnection: 'xxx'
subscriptionId: 'xxx'
action: 'Create Or Update Resource Group'
resourceGroupName: 'xxx-we-rg'
location: 'West Europe'
templateLocation: 'Linked artifact'
csmFile: 'arm/we.json'
csmParametersFile: 'we-param.json'
deploymentMode: 'Incremental'
- stage: ne
condition: xxx
jobs:
- job: Deploy-ne
steps:
- task: AzureResourceManagerTemplateDeployment@3
inputs:
deploymentScope: 'Resource Group'
azureResourceManagerConnection: 'xxx'
subscriptionId: 'xxx'
action: 'Create Or Update Resource Group'
resourceGroupName: 'xxx-ne-rg'
location: 'North Europe'
templateLocation: 'Linked artifact'
csmFile: 'arm/ne.json'
csmParametersFile: 'ne-param.json'
deploymentMode: 'Incremental'
请注意,这不是如何触发“释放管道”的问题。
Azure Devops, yaml pipeline, trigger particular stage by PR.
Is it possible to trigger a particular stage by different PRs completion (not by creating a build or PR and then trigger another build pipeline)?
Example below, if I update we.json
and merge a PR to my Azure repository, I want PR to trigger my pipeline and particularly the stage Deploy-we
only, and not trigger Deploy-ne
.
trigger:
branches:
include:
- main
paths:
include:
- arm/we.json
- arm/ne.json
pool:
vmImage: ubuntu-latest
stages:
- stage: we
condition: xxx
jobs:
- job: Deploy-we
steps:
- task: AzureResourceManagerTemplateDeployment@3
inputs:
deploymentScope: 'Resource Group'
azureResourceManagerConnection: 'xxx'
subscriptionId: 'xxx'
action: 'Create Or Update Resource Group'
resourceGroupName: 'xxx-we-rg'
location: 'West Europe'
templateLocation: 'Linked artifact'
csmFile: 'arm/we.json'
csmParametersFile: 'we-param.json'
deploymentMode: 'Incremental'
- stage: ne
condition: xxx
jobs:
- job: Deploy-ne
steps:
- task: AzureResourceManagerTemplateDeployment@3
inputs:
deploymentScope: 'Resource Group'
azureResourceManagerConnection: 'xxx'
subscriptionId: 'xxx'
action: 'Create Or Update Resource Group'
resourceGroupName: 'xxx-ne-rg'
location: 'North Europe'
templateLocation: 'Linked artifact'
csmFile: 'arm/ne.json'
csmParametersFile: 'ne-param.json'
deploymentMode: 'Incremental'
Note, this is not a question how to trigger a 'release pipeline'.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论