3

Using a git source repo in Azure DevOps - what is the proper way to clean all directories, sources, sources directory, etc. when queuing a new build?

There is UX under Get Sources that supports this - but you can't assign your own custom variables for the values - it's a static dropdown for both Clean and Clean options fields.

enter image description here

SliverNinja - MSFT
  • 31,051
  • 11
  • 110
  • 173
  • If I'm understanding correctly, your question is specifically about how to optionally clean (with different option) or not at queue time? – Matt Apr 17 '19 at 19:38
  • 1
    90% of our builds work fine with incremental builds - just like local development. On occasion we need to clean when we queue - [that's what `Build.Clean` used to be used for](https://stackoverflow.com/a/47544921/175679). This option was deprecated and there doesn't appear to be any documentation on where this option was moved to - ended up [tracking down the build agent source to resolve](https://github.com/Microsoft/azure-pipelines-agent) – SliverNinja - MSFT Apr 18 '19 at 04:43

1 Answers1

3

Stumbled across this docs posting, but it states Build.Clean is deprecated - but the docs aren't clear that Build.Repository.Clean is now the successor. This is what seemed to work for me:

Clean Sources Only

enter image description here

Note: I can confirm Build.Clean = true doesn't work anymore.

The DevOps self-hosted agent is OSS - so I was able to confirm support for this undocumented flow using Build.Repository.Clean. I don't believe there is a way to assign the clean options at queue-time though.

SliverNinja - MSFT
  • 31,051
  • 11
  • 110
  • 173