How to : Get artifacts from server in script

Hi, I'm using TC 4.0.2 and I have some projects that generate artifacts.
Those are libs that are needed by other developpers. I'm trying to figure out how to allow them to get thoses libs.
Artifacts can be retrieve using url (http://www.jetbrains.net/confluence/display/TCD4/Patterns+For+Accessing+Build+Artifacts), but they need to be download 1 by 1 and some of my artifacts directories contains 300+ files . Next TC release will add a "download all" feature (http://jetbrains.net/tracker/issue/TW-220) but its future...
I can also share the server artifacts directory, which is a good solution for me, but the structure is <TeamCity Data Directory>/artifacts/<project name>/<build configuration name>/<internal_build_id>. Now if I'm using a script (.bat), how can I translate .lastSuccessfull build to internal_build_id ?? In other words, how can I wrote a script that will return all the files inside the last successful dir or how can I get the "last" internal_build_id to put in a script?

Thanks

3 comments
Comment actions Permalink

I'm also thinking about creating a dependent build that will only be used to move the artifacts to another location.
But that will create extra builds and i'll need to give the agents access to the target destination which may be tricky because they currently run as a service in system account.

0
Comment actions Permalink

Hello,

   I suppose that making such a 'deployment' configuration may be a way to go. You can specify any user account to run build agent under,
   and you can create aggressive cleanup policy to delete such unneeded deployment build.
  The only problem is that you can't deploy artifacts to a network share, if build agent runs as a windows service.

   We plan to add a feature which would allow to create post- and pre- build steps to build configurations:
   http://jetbrains.net/tracker/issue/TW-3660

   Alternatively, you can use Ivy to access artifacts from external scripts (even if they are run outside of TeamCity):
   http://www.jetbrains.net/confluence/display/TCD4/Configuring+Dependencies


  Hope this helps,
  KIR

P.S. Unfortunately, there is no HTTP API to obtain internal build_id for last successful build.

0
Comment actions Permalink

Ok, I have vote for that issue, which may be very usefull. Other CI server have that abilities to run post/pre build script.
Well I guess I will have to parse some grep result to determine the last build artifact directory.
If someone already have a solution like that, feel free to post.

0

Please sign in to leave a comment.