Anthony Mastrean
Anthony Mastrean

Reputation: 22394

How do I download an artifact from an archive in TeamCity 6.5? I can't construct the correct URL

I have a zip archive artifact. I'm interested in downloading a single file from that artifact. I can't upload that file outside of the archive right now. The documentation says you download an archive like this

/repository/download/BUILD_TYPE_ID/BUILD_ID:id/ARTIFACT_PATH

So, my URL for that looks like this (and I need anonymous access, so you see the guest flag). And it works!

/repository/download/bt23/2253:id/mypackage.zip?guest=1

However, I want one single file from that artifact. And the docs are confusing on how to do that. They do not specify what replaces <zip or jar archive>. And I am not constructing the whole buildNumber or buildTypeId values properly.

/repository/archive/<zip or jar archive>/buildTypeId/BUILD_TYPE_ID/buildNumber/BUILD_NUMBER/index.html

I tried using zip and `.zip'. I tried filling in the build values directly, but it's much different from the working archive download URL.

/repository/archive/zip/buildTypeId/bt23/buildNumber/2253/myfile.txt?guest=1

Does anyone have working concrete example of the URL for a single file in an archive?

Upvotes: 3

Views: 1223

Answers (1)

Pavel Sher
Pavel Sher

Reputation: 2211

You need to replace <zip or jar archive> with relative path to your artifact. For example, if you want to retrieve file.txt from package.zip which is uploaded under dist directory in your build artifacts you need to use this url: http://server/repository/archive/dist/package.zip/buildTypeId/bt23/buildNumber/2253/file.txt?guest=1

BTW, a new, more straightforward URL syntax will be available in TeamCity 7.0: http://server/repository/download/bt23/2253/dist/package.zip!file.txt?guest=1

Old URLs will be supported too.

Upvotes: 3

Related Questions