9
votes

When on the artifacts page in TeamCity, there is an option to download all the artifacts as a zip file.

I was wondering if you can set up dependent build configurations to actually grab the zipped version of the artifacts?

I realize I could zip all the artifacts in the project configuration that initially creates them, but I'd rather not do that.

Alternatively, I could use something like Nant to zip them once they are brought over, but I would imagine that the transfer of these artifacts could probably go a bit faster if the files being sent were zipped in the first place.

Is anyone aware of a way to transfer the zipped artifacts from each of the other projects or if this is supported by TeamCity?

2
Did you ever find an answer to this?reach4thelasers

2 Answers

17
votes

Yep. This is pretty straightforward, at least with the current version of TeamCity (6.5.3). In your "main" project, create the zipped artifact:

MyProjectBuildFolder\** => mybuild-%system.build.number%.zip

After your build, you will see all of your files in the zip artifact. Then create a new build configuration. You will want to edit the dependencies of this build and add a new "artifact dependency". Edit its properties like so:

  1. Depend on: The build configuration from your main project from above.
  2. Get artifacts from: Last successful build
  3. Artifacts paths: If you want to just copy the zip file, this will be *.zip. If you want TeamCity to unpack the zip file for you, use *.zip!**.
  4. Destination path: %some.parameter.representing.your.path%

Now when the runner for the dependent build is kicked off, it will grab the latest zip archive from your main project and unpack it into your dependent build's destination folder.

0
votes

Probably, you could obtain zipped artifacts manually, in your first build step, by constructing URL to the dependent configuration. In the build, you can get parameters of your dependent builds, which can help you to build the URL.

URL looks like: http://your.server/(guestAuth|httpAuth)/repository/downloadAll/bt457/12345:id/artifacts.zip

where bt457 - id of your build configuration 12345 - build id of the dependent build, which you should be able to obtain in your build as system property dep.bt457.teamcity.build.id

read more here: http://confluence.jetbrains.net/display/TCD6/Predefined+Build+Parameters#PredefinedBuildParameters-DependenciesProperties

All of this not very elegant, but it should work