tags:

views:

115

answers:

2

Hi, how can I copy the artifacts from Teamcity to another server? Thanks

A: 

You can do it from your build script or externally.

CrazyCoder
Thank you for your prompt response. Can you tell me how to run this external command? /repository/download/BUILD_TYPE_ID/.lastSuccessful/ARTIFACT_PATH
Raul
It's not a command, just a part of the URL you should use. Create the full URL by adding the server URL and port and use this URL with some tool like wget or curl or any other tool which is able to perform HTTP downloads.
CrazyCoder
Can you tell me how can I specify in the MSBuild script the server destination for the copy task?
Raul
I don't understand what you need, if you want to copy the artifacts from the build running on the agent, then refer to the MSBuild documentation. If you want it the other way, then write a tool which will fetch the files via HTTP from the TeamCity server as I've described above.
CrazyCoder
A: 

The way I have done this, make things a lot easier.. Setup another configuration that pulls in, via artifact dependencies, all the files you need then run a cmd script to xcopy/copy the files to another drive on the network. You can do this using cmd script, vbs, python, shell etc..

  • Remember, you only need to refer to directories as if they were local as you would have your script in the same working directory

i.e cmd script :: xcopy .\"my build artifact(s)" \path\to\drive\on\my\network\"my build artifacts"

It doesn't get easier than that.

Naturally, if your artifacts are huge, then you may want to consider your more complicated option. However, TeamCity currently have a ticket pending, which you can vote on, that allows you to run multiple runners in one configuration - so you could just add your cmd script to the same configuration to save the copy time; please vote if can spare a minute:

http://youtrack.jetbrains.net/issue/TW-3660

monkeysee