4
votes

We've just expanded our TeamCity footprint so that we now have multiple agents running on separate servers (they all used to be on the same server).

The issue we are running into is during a build that has multiple steps, where the last step depends on the artifacts that have been created by a previous step. It seems that the same agent is not used for all of the build steps. Therefore when Build Agent 1 creates an artifact in C:\BuildAgent\work\785e028597a0a18d\src\\obj\octopacked, the last step cant seem to find it because the last step seems to run on the other agent, Build agent 2, which of course doesnt have that artifact on that server.

Do I just need to use a UNC path for the artifacts instead, or am I missing something here? I thought that one build configuration would always use the same Build Agent, but it seems that is not the case.

Any help would be greatly appreciated.

Regards,

dotdev

1
Can you just clarify - You say a multiple step build - Do you mean a build that has a number of configurations i.e. one build configuration is dependent on the build artifacts of another? Steps are generally run on one agent.Evolve Software Ltd

1 Answers

2
votes

If you are publishing the build artifacts correctly then different agents will be able to resolve them correctly. My hunch is they aren't being published or maybe they aren't being consumed correctly either.

1. Ensure you are publishing your artifacts using the following field, but as I can see you're using Octopack then this should be published automatically. It might also be worth checking that the flag /p:OctoPackPublishPackagesToTeamCity=false isn't being passed as a build parameter in the compilation step

enter image description here

2. In the dependent build configuration, ensure you are consuming the artifact correctly

enter image description here

This will ensure that the .nupkg is available in the working directory of the agent that starts this build configuration. If it's not there then look at the step producing the artifact to ensure it's being published.

Hope this helps