tfstfsbuildazure-pipelinesvnext

TFS 2015 / vNext Build - Set Build.Clean Control Variable in a build step


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


Solution

  • 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: