Azure-pipelines-agent: Can't specify clean options in yaml

Created on 26 Apr 2018  路  7Comments  路  Source: microsoft/azure-pipelines-agent

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?

enhancement

Most helpful comment

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.

All 7 comments

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

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

riezebosch picture riezebosch  路  4Comments

TLaborde picture TLaborde  路  3Comments

alexrainman picture alexrainman  路  5Comments

johncollinson2001 picture johncollinson2001  路  4Comments

bzuu picture bzuu  路  4Comments