With checkout I can say clean true but how do I select Sources, all build directories, etc.
Also When I look at VSTS UI Yaml I see resources instead of checkout task? What's the difference, which should I use?
I would suggest using the checkout task. there is a bug with the top level resources right now, the settings don't get applied unless you also add checkout: self
The other options are currently missing. I'll add it to the feature gaps document.
Any progress on this. I still don't see the flexibility to select "Sources", "All Build Directories", etc. This leads to having to author another task to run before checkout that deletes files from the agent which is less than desirable.
Another related issue is if you use the "View YAML" link in an existing visual build it does not use the checkout task but instead the "resources" and that doesn't seem to work at all.
We have created a new repository for all YAML related issues, please move the current issue to there.
https://github.com/Microsoft/azure-pipelines-yaml
workspace.clean is supported now.
https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts#job
if you set all is equivalent to All Build Directories. I think resources is equivalent to creating the sources directory.
If you just want to run git clean -fdx and git reset --hard, then set clean on the checkout step. https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts#checkout
workspace.clean doesn't look like what I need. At least per the docs, it says it cleans things up after the build runs. But I need to clean up before the build runs. "Why" you ask? Because I have builds that weren't cleaning before. And it's screwing up subsequent builds. I need to clean before, so that it cleans up the mess left by builds that didn't clean up after themselves.
Looking at workspace.clean:
- job: myJob
workspace:
clean: outputs | resources | all
none is missing and it seems that outputs is indeed the default.
Most helpful comment
workspace.cleandoesn't look like what I need. At least per the docs, it says it cleans things up after the build runs. But I need to clean up before the build runs. "Why" you ask? Because I have builds that weren't cleaning before. And it's screwing up subsequent builds. I need to clean before, so that it cleans up the mess left by builds that didn't clean up after themselves.