2

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

Heath
  • 23
  • 4

1 Answers1

2

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:

Andy Li-MSFT
  • 28,712
  • 2
  • 33
  • 55
  • That makes a lot of sense. Thank you! – Heath Nov 29 '17 at 12:14
  • I've been reading the second link up and down, `Build.Clean` is deprecated but those hints in the link regarding various versioning systems are not clear enough for me to understand how I could purge a workspace when I *queue* a build. – Samuel Apr 25 '19 at 12:04