问题
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?
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
回答1:
No, it can only be set at queue time.
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.
Reference:
Control variables
Clean the local repo on the agent--
TFS 2017 RTM, TFS 2015.4
area.
来源:https://stackoverflow.com/questions/47533521/tfs-2015-vnext-build-set-build-clean-control-variable-in-a-build-step