admin管理员组文章数量:1122846
I'm new to working with DevOps pipelines and could use some help. First off, I am working with database code and not application code. Not sure if that makes a difference when it comes to best practices or not.
In my repo I have a dev branch and a main branch. When I merge code into the dev branch I want the pipeline to deploy my code to my dev environment. Then when I merge code to the main branch I want it to deploy to my prod environment. The code I want to deploy is also in a subfolder in those branches, so I only want the pipeline to run when a merge takes place in a specific sub folder.
I currently only have 1 pipeline defined, and it looks like it defaults to pointing to the pipelines.yml file in the main branch.
Here are some snippets from my current pipelines.yml file.
trigger:
batch: true
branches:
include:
- dev
- main
paths:
exclude:
- README.md
- LICENSE
- .github
include:
- dev/.bundle/* # Path in dev branch to trigger dev stage
- main/.bundle/* # Path in main branch to trigger main stage
stages:
- stage: toDev
variables:
- group: Dev
condition: |
eq(variables['Build.SourceBranch'], 'refs/heads/dev')
..........
..........
..........
- stage: toProd
variables:
- group: Prod
condition: |
eq(variables['Build.SourceBranch'], 'refs/heads/main')
When I merge a new test file to the dev.bundle folder the pipeline does not do anything, so I must be missing something here. Any help is appreciated.
I'm new to working with DevOps pipelines and could use some help. First off, I am working with database code and not application code. Not sure if that makes a difference when it comes to best practices or not.
In my repo I have a dev branch and a main branch. When I merge code into the dev branch I want the pipeline to deploy my code to my dev environment. Then when I merge code to the main branch I want it to deploy to my prod environment. The code I want to deploy is also in a subfolder in those branches, so I only want the pipeline to run when a merge takes place in a specific sub folder.
I currently only have 1 pipeline defined, and it looks like it defaults to pointing to the pipelines.yml file in the main branch.
Here are some snippets from my current pipelines.yml file.
trigger:
batch: true
branches:
include:
- dev
- main
paths:
exclude:
- README.md
- LICENSE
- .github
include:
- dev/.bundle/* # Path in dev branch to trigger dev stage
- main/.bundle/* # Path in main branch to trigger main stage
stages:
- stage: toDev
variables:
- group: Dev
condition: |
eq(variables['Build.SourceBranch'], 'refs/heads/dev')
..........
..........
..........
- stage: toProd
variables:
- group: Prod
condition: |
eq(variables['Build.SourceBranch'], 'refs/heads/main')
When I merge a new test file to the dev.bundle folder the pipeline does not do anything, so I must be missing something here. Any help is appreciated.
Share Improve this question edited Nov 22, 2024 at 22:14 Rui Jarimba 17.4k11 gold badges64 silver badges97 bronze badges asked Nov 22, 2024 at 21:15 AMNAMN 495 bronze badges 2 |2 Answers
Reset to default 0I tested the same yaml in my pipeline, it will be triggered when I changed or merged a file to the dev/.bundle
or main/.bundle
folder.
Please check the steps to troubleshoot your failing triggers:
Check if your YAML CI trigger is overridden by pipeline settings in the UI. You can edit your pipeline, choose ... and then Triggers.
Check if the Override the YAML trigger from here setting is turned on.
Check if your pipeline paused or disabled. Open the editor for the pipeline, and then select Settings to check. If your pipeline is paused or disabled, then triggers do not work.
For more steps to troubleshoot your failing triggers, please refer this Q&A: I just created a new YAML pipeline with CI/PR triggers, but the pipeline isn't being triggered.
I figured out what my issue was. In the include paths I had the branch name again where I only needed the path. It's working now.
本文标签: Azure DevOps pipeline deploying to multiple environmentsStack Overflow
版权声明:本文标题:Azure DevOps pipeline deploying to multiple environments - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736300819a1930956.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
batch: true
? – Rui Jarimba Commented Nov 22, 2024 at 22:15