构建保留策略 - 最大构建数 [英] Build retention policy - maximum number of builds

查看:25
本文介绍了构建保留策略 - 最大构建数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个构建定义,每天触发 5 到 10 次.

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.

推荐答案

在前 TFS 中,Xaml 构建可以配置为只保留最后 x 个构建(例如,保留最后 5 个构建).

In pre TFS, Xaml builds can be configured to only ever keep the last x builds (e.g. keep the last 5 builds).

但是,vNext 构建改变了它的工作方式,将构建保留 x 天,并保持最少 y.

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:

为 vNext Build 恢复旧式保留策略定义

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

作为一种解决方法,您可以尝试使用 TFS API 来执行此操作.您可以运行一个实用程序来清理构建的构建工件放置位置.这是链接中skundu回答的示例.

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.

这篇关于构建保留策略 - 最大构建数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆