views:

544

answers:

1

Aim: Set up an ant/cmd script that will package the artifacts from several builds into a single zip. I plan to do this by setting up a final build configuration that will have a dependency on those several projects.

So all my build configurations build successfully and produce build artifacts on the Build Server @.BuildServer\system\artifacts{PROJECT}{several configurations}.. In my "Artifact Aggregating" configuration, I need to be able to reference what and where those artifacts are using variables that can be used in my ant/cmd script. i.e. I have Project A with configurations w, x, and y; how would I define/construct I variables of these configurations(w,x,y) that can be referenced by build configuration z. I looked at current Teamcity documentation i.e. http://www.jetbrains.net/confluence/display/TCD3/System+Properties+of+a+Build+Configuration#SystemPropertiesofaBuildConfiguration-ref; but I find this doesn't resolve my query.

Is there a way I can set up my artifact paths for configurations w, x and y to make the final task easier?

What would be the best way to accomplish this task? Any ideas are welcome.

A: 

This is how we do that.

  1. Create n+1 Configuration(ZIP_ALL) and add dependency for all n projects see Dependency trigger
  2. Create network share \\server\Build for aggregating project's building results
  3. (you need cleanup strategy for that folder) - we simply drop all, our teammates create sub folders with SVN rev name (TC sets variable with revision value)
  4. For each configuration create msbuild(or ant, or rake) script, that will build and zip (if you need) all output from build
  5. Copy zip file or complete Output folder to common location (\\server\Build) see Copy Task
  6. Create ant script for ZIP_ALL configuration that simply zips all files in common location
  7. Publish that to TeamCity via Artifact Publishing
Sergey Mirvoda