本文介绍了TFS 2015/vNext Build-在构建步骤中设置Build.Clean控制变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以根据构建的排队方式在构建步骤(而不是在排队时)设置Build.Clean控制变量?

Is it possible to set the Build.Clean control variable during a build step (Not at Queue Time), based upon the way the build is queued?

例如,我有一个构建,如果它在白天手动排队,我希望它递增运行.如果它在深夜按计划运行,我希望它执行Build.Clean,然后在构建代理上重新创建Binaries(b)文件夹.

For instance, I have a build that if queued manually during the day, I want it to run Incrementally. If it runs on its schedule in the middle of the night, I want to have it do a Build.Clean, recreating the Binaries (b) folder on the build agent.

似乎必须在队列时间设置此控制变量,因为构建会在执行任何构建步骤之前先在代理上运行此操作.我只是好奇是否有人之前曾遇到过此要求,或者是否有可能.谢谢

It seems like this control variable has to be set at queue time, because the build runs this operation on the Agent prior to executing any of the build steps themselves. I'm just curious if anyone else has run into this requirement before, or if it is even possible. Thank you

推荐答案

否,只能在队列时间设置.

No, it can only be set at queue time.

在您的方案中,您可以创建两个构建定义.一个用于增量构建(禁用Clean选项,Clean = False),另一个用于半夜构建启用Clean选项.

In your scenario, you can create two build definitions. One for incremental build (Disable the Clean option, Clean = False), and another enable the Clean option for middle of the night build.

参考:

清理代理上的本地仓库-TFS 2017 RTM, TFS 2015.4区域.

这篇关于TFS 2015/vNext Build-在构建步骤中设置Build.Clean控制变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 11:53