I would like to have the following pipeline implemented in Azure DevOps:
- One
Build
stage that builds the main artifact - 3 deployment stages for
Dev
Preprod
andProd
that would deploy the artifact built in the previous stage to their respective environments
I can do that using Azure DevOps Multistage Pipelines and conditions
on the branch name. However, when I push first to dev
branch and it builds successfully, and then I push to say preprod
branch as a Fast-forward, I would expect the pipeline to reuse the already built artifacts from the Build
stage run in the dev
branch, because those are the same commits.
What I observe in DevOps is that the Build
stage is rerun even for the same commit, when I push to each different branch. Is it possible to achieve what I am trying to do using YAML-based pipelines?
Edit
The whole point of this workflow is not branching but rather staged deployment, from continuous deployment of latest and greatest dev commits down to rolling-out production-ready software for our 500+ internal users. What I am trying to achieve is something called build promotion where one and the same build artifact gets promoted to an increasingly large circle of users. I would be happy to achieve this without fiddling with git branches.