Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TeamCity Zipped Artifact Dependency

Tags:

teamcity

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?

like image 433
brandogs Avatar asked Jan 07 '11 20:01

brandogs


People also ask

What is artifact dependency?

The Artifact Dependency Graph (ADG) of an artifact is the recursive DAG (Directed Acyclic Graph) of all the input artifacts that are transformed by a build tool into that artifact. It includes the direct input artifacts, and the recursive set of artifacts to each input artifact, all the way down to source code.

Where are TeamCity artifacts stored?

The artifacts are stored on the server "as is" without additional compression. By default, the artifacts are stored under the <TeamCity Data Directory\>/system/artifacts directory which can be changed. You can configure an external artifacts storage to replace the built-in one.

What is snapshot dependency in TeamCity?

A snapshot dependency alters the builds' behavior in the following way: when a build is queued, so are the builds from all the build configurations it snapshot-depends on, transitively; TeamCity then determines the revisions to be used by the builds ("checking for changes" process).

What is artifact path in TeamCity?

Artifact Paths Build artifacts are files produced by the build which are stored on TeamCity server and can be downloaded from the TeamCity UI or used as artifact dependencies by other builds.


1 Answers

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.

like image 129
Chris Farmer Avatar answered Oct 15 '22 12:10

Chris Farmer