freefall
freefall

Reputation: 398

Downloading TeamCity artifact dependencies using REST

We've got a TeamCity (9.1) build configuration which is based on several snapshot dependencies to build correctly. I'm looking for a convenient way to provide each developer with a way to set up a proper build environment on their desktops. For this, I would like to download all the snapshot dependencies for a given build configuration from the TeamCity server onto the developer's desktop using the REST api.

I'm aware of how to access artifacts using REST. But this would address the artifacts created by a specific build configuration. I'm looking for a way to download all artifacts used by a given configuration specified by the dependencies.

Upvotes: 1

Views: 624

Answers (1)

spencerwjensen
spencerwjensen

Reputation: 712

There isn't an easy way to do this, however, it's not impossible. My answer is provided below followed by a possible alternate solution.

Answer:


The artifacts used by your target build are really just the artifacts that were created by its dependencies right?

I think what you are looking for is referenced here where you can query a build for all of its Snapshot Dependencies.

Once you have a list of the dependencies you would then need to query each of them for the artifacts they generated and then you could proceed to download them.

It's not the most straightforward thing and would require some slick Powershell or Python or whatever, but it is doable.

Another Idea:


Have you looked into something like Artifactory? It sounds like what you really need is a binary repository of sorts to track artifacts used, and artifacts created.

Or for small projects, you could probably get a way with just using a file share on the network where the build could "copy" to the share organizing files into "build" directories of some sort and then developers could "read" from the share.

Upvotes: 1

Related Questions