How do you schedule a stage to run at a particular time of day in a multi stage azure devops pipeline but for only the latest build?
For example, let's say I have a combined build and release pipeline...
- I do 4 check-ins that day
- 4 pipelines, each with a build and release stage are created (1 for each check-in). The build phases complete as the code is merged
- I don't want to deploy after every check-in so I schedule the release stage to run overnight
Once it reaches the release scheduled time isn't it going to kick off 4 simultaneous deployments for each pipeline that was created that day? How would I ensure it only schedules the latest? What if I wanted to ensure it also runs that deployment stage even if there have been no code changes?
I can solve this requirement with classic releases by scheduling the release to be created and deployed at a certain time with the latest artifact. It then doesn't matter how many builds were run that day.