Copy artifact dependency to agent

Let's say I have two projects (ProjectA and ProjectB) and two agents (AgentA and AgentB). ProjectA is only built by AgentA, and ProjectB is only built by AgentB. AgentA and AgentB are different machines (and may even be running on different platforms).

ProjectA creates several artifacts and has no artifact dependecies on any projects.

I want ProjectB to have an artifact dependency on a specific build of ProjectA (say, build #42) and a specific artifact (say,

Since AgentA and AgentB are on different machines, AgentB does not have the artifacts that AgentA has created from the ProjectA build. But the TeamCity server will have those artifacts.

When I click the "Run" button on ProjectB, I would like the server to copy the artifact from build #42 of ProjectA over to AgentB (and then AgentB will do something with

How do I set this up with TeamCity 7.1.5?

Comment actions Permalink


What you describe is exactly "Artifact dependency" feature.

In your ProjectB's dependencies settings, add new artifact dependency, select "ProjectA" as a source configuration, "Specific build number" as source build, "" and destination as you wish. After that, TeamCity will provide required artifact before build starts.

More details ca be found here:

Comment actions Permalink

Hi Nikita,

I've tried reading through the documentation but it's not clear.

Can you give me a detailed answer?


1. What does the "artifact rule" I need to use look like exactly?

2. Where will the artifact be copied on the local disk of the agent?

Comment actions Permalink

The artifact rule in general looks like this: => destination/directory/path

resulting location of downloaded is "<SourcesCheckouDir>/destination/directory/path", so the destination in the example above is relative to checkout directory.

Comment actions Permalink

Thanks, that's what I was looking for.

Can the TeamCity agent also automatically expand into /destination/directory/path/ ? I don't have control over the Windows build agents we use, and none of them have a Zip utility installed.

Comment actions Permalink

Yes, TeamCity can extract "zip" and "tar.gz" content for you. Extracted files can also be filtered using patterns. E.g.:!** => destination/path           --- will extract all files and directories to "destination/path"!**/*.txt => destination/path    --- will extract all txt files preserving directories structure to "destination/path"


Please sign in to leave a comment.