Trigger different environments in one pipeline
I have a dev, uat, and prod environment for my ado project, and I just completed a pipeline deploy to dev.
Is it better practice to have a second pipeline that triggers on the uat branch, or is another stage in the same pipeline a better approach?
I'm leaning towards having a single pipeline, but am unsure how to set up a PR with a manual approval for uat.
Is this even an approach I should be investigating?
maybe you can go in to a bit more details on the branching strategy you follow for example git flow as that will impact how you setup your CI/CD Pipelines.
For us we have one Pipeline for CD that will build the Development Branch (Git Flow) to deploy to our UAT Environment but automatically skip the Prod environment stage if the branch is called Develop* or Feature*
If the Branch starts with Release/* it will go throe the build stage, the UAT Deployment stage, The Automated Testing stage (Against UAT) and then the Production Stage, see below graphic to illustrate.
What I like on this approach is that you use the exact same code package (artifacts) on UAT and Prod, in your case that would be Dev, UAT and Prod.
In our case the CI Pipeline is a separate Pipeline and uses the same yaml templates for the build but only deploys to the Automated Test environment and is triggered by a Pull Request Policy