Download artifacts on agent from previous build

Hi,

I need to be able to download artifacts from a specific previous build to the agent-side part of my build runner plugin. I know about the built-in artifact dependencies, but I can't use this because I need my plugin to do it automatically. I also know I can do this via Ivy, but I don't want to rely on Ivy.

Currently, I'm using the REST API to download the artifacts on the agent, but this requires that guest authentication is enabled, because obviously the agent will not have HTTP credentials. But I need to change this, to not rely on guest authentication being enabled. And I do not want to be dealing with usernames and passwords.

Is there a way I can use the classes in jetbrains.buildServer.artifacts (such as DependencyResolver) to acheive this? It would be sort-of a reimplementation of the built-in artifact dependency feature, but configurable from within my build runner. If this is possible, it would be great if I could have a pointer in the right direction.

I read this: http://devnet.jetbrains.com/message/5287279#5287279 but couldn't see anything useful.

Thanks,
Justin

4 comments
Comment actions Permalink

Update: I tried to use teamcity.auth.userId/teamcity.auth.password with the REST API call while the build was running, but I got a 401.

0
Comment actions Permalink

Justin,

Yes, using values of teamcity.auth.userId/teamcity.auth.password parameters is due way. Please doublecheck the requests you invoke via a command line tool, etc. The credentials can be used only while the build they generated for is running.

If you still cannot download fileds please detail at what time you issue the requests and provide dump of the requests send and responses received.

BTW, could you share what kind of plugin you are writing?

0
Comment actions Permalink

Yegor,

Thanks for the reply. I wasn't passing the credentials in the HTTP request properly - it works great now.

I'm writing a plugin that checks the binary and source compatibility (C++ shared libraries and headers) of a build with a previous reference build (tag-based). The plugin depends on the artifacts of the reference build - the artifacts can be archives (tarballs, zips etc), RPMs, .debs or simple directory trees. It unpacks the artifacts and runs an external tool to check the actual compatibility, then displays the results in a tab on the build results page, telling you which symbol additions/deletions, etc. have broken your ABI compatibility (if any).

If you'd like, I can share the plugin so others can use it? What's your procedure for this? I would very much like to contribute.

Thanks,
Justin

0
Comment actions Permalink

Justin,

Thank you for the description.

> If you'd like, I can share the plugin so others can use it? What's your procedure for this? I would very much like to contribute.

If you find it generic enough to be usable by others, it would be great if you can share the plugin.

Usually plugin authors publish sources in some public repositories, github and Google code being probably the most popular and we just give a link from the plugins page.
If necessary, we can also setup a build for the plugin on http://teamcity.jetbrains.com/ (provided no external dependencies are used).

0

Please sign in to leave a comment.