Rick de Water
Rick de Water

Reputation: 2632

Copying artifacts between builds in Team Services

Our code is separated into multiple projects. The libraries from project A are then used by project B, which is then used by project C, etc. However, I can't find a way to share artifacts between builds.

All build steps are about publishing the artifacts, but none seem to be about downloading them (except for Jenkins Download Artifacts, which is exactly what I need, but for team services instead).

Since this is all done on a hosted agent, I also cannot copy the files to a location known by all builds.

I have also tried the Download Artifacts extension, but this one only works for releases, and not for builds.

So how do I get the artifacts from build A into build B?

Upvotes: 3

Views: 1399

Answers (1)

Chris Melinn
Chris Melinn

Reputation: 2076

If the projects reside within the same repository, then you could have a single build definition that has multiple build steps. For example, first build Project A and then output to a folder that is reference by Project B, etc.

If the projects reside within different repositories, then its not so clean. The Publish Build Artifacts build step, however, does have an option to publish to a file share. I suppose you could then reference the file share as part of the subsequent project build.

However, I would highly recommend changing your approach slightly. If you have shared projects (such as your Project A), then you could build and publish these artifacts as a private Nuget Feed. Then, Project B can add the private Nuget feed as a referenced package, just like any other Nuget package. Then, this will work for VSTS builds as well as local builds and you can determine which versions you want, etc.

There is a VS Team Services extension for Package Management that can help you accomplish this. These references may also help:

Upvotes: 2

Related Questions