We have a build definition that gets triggered between 5 and 10 times per day.
We want to keep only the last build.
How can we achieve this with the build retention policy? The policy accepts only minimum number to keep and not the maximum number.
We have a build definition that gets triggered between 5 and 10 times per day.
We want to keep only the last build.
How can we achieve this with the build retention policy? The policy accepts only minimum number to keep and not the maximum number.
In pre TFS, Xaml builds can be configured to only ever keep the last x builds (e.g. keep the last 5 builds).
However, vNext builds change how this works, to keep builds for x number of days, and keep a minimum of y.
I'm afraid you need the feature like old retention policy. There had been a related user voice:
Bring back old style retention policies for vNext Build defintions
https://visualstudio.uservoice.com/forums/330519-visual-studio-team-services/suggestions/8266650-bring-back-old-style-retention-policies-for-vnext
However it got completed by adding the control of build numbers. Just not have the keep latest option. Unfortunately, you could not achieve this with the build retention policy
As a workaround you could try to use TFS API to do this. You could run a utility to clean the build artifact drop location for builds. Here is a sample from skundu's answer in the link.
You can manage the complete retention policy, the minimum number to keep and the maximum number for a team project collection. You can change the policy on the Build and Release Settings on your account or the team project account:
VSTS: https://{your_account}.visualstudio.com/_admin/_buildQueue
TFS 2017: https://{your_server}/tfs/DefaultCollection/_admin/_buildQueue
TFS 2015 Update 3: http://{your_server}:8080/tfs/DefaultCollection/_admin/_buildQueue
TFS 2015 RTM: http://{your_server}:8080/tfs/DefaultCollection/_admin/_buildQueue#_a=settings
You can find more info about this here Build and release retention policies
I hope this helps you
If you are using VSTS, your builds are not deleted until 3 A.M. UTC that day.
Following is taken from the documentation
https://docs.microsoft.com/en-us/vsts/build-release/concepts/policies/retention
Your retention policies run every day at 3:00 A.M. UTC. There is no option to change this process.
If you are looking to get only the latest build, set the minimum number to 1. The maximum number of build retained cannot be changed for a particular build. You will need to change it to 1 for team project collection . But as I mentioned earlier, it won't mean that you will always have 1 build.