Mr. Boy
Mr. Boy

Reputation: 63778

If I run multiple VSTS build agents on the same machine, can they share a work folder?

This questions makes clear you can run multiple build agents on a single machine, by having one agent per directory e.g. c:\agent1, c:\agent2: VSTS build agents - Can one computer run multiple build agents?

But, when configuring these agents can they use the same work folder or must they be distinct e.g. c:\builds\ Vs c:\builds\1 c:\builds\2?

Upvotes: 0

Views: 303

Answers (1)

Yan Sklyarenko
Yan Sklyarenko

Reputation: 32270

According to the MS docs:

The work directory is owned by a given agent and should not share between multiple agents.

In general, build agents check out the source code into the working directory, and then work with the sources being pulled from the repository. If you allow two agents to point to a single directory, you'll end up with a mess and unpredicted build results, at the very least.

I think one special case could be if you disable the option to check out the source code, and in this case build agents just run certain embedded scripts. But it's not a common case, anyway, and if you never share the working directory between the agents, you're always on a safe side.

Upvotes: 1

Related Questions