views:

489

answers:

2

Hello,

I want to copy the output files from my build to a staging server, but I can't figure out how to find the path used by TeamCity to store the build output in from in MSBuild. Any help?

Thanks!

+1  A: 

The best way is to upload the files to teamcity. Choose step1 (General Settings) and enter artifacts path. It should be something like /SourceOfProject/bin/releaese/*.dll.

I zip files before I upload them, because you only want to download 1 file that contains the complete build. My build always has 2 steps in a nant - file.

Step1 - call msbuild

Step2 - use 7zip to create zip

<?xml version="1.0"?>
<project name="MyProjectBuild"
 default="build"  basedir="."
 xmlns="http://nant.sf.net/release/0.85/nant.xsd"&gt;

 <description>Build Script</description>
 <target name="build" >
 <exec program="C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe"    >  
 <arg value="MyProject\MyProject.csproj" />
 <arg value="/t:Build" />
  <arg value="/p:Configuration=Release" />
 </exec>

   <exec program="7z"    >  
 <arg value="a" />
 <arg value="MyProject\bin\release\buildresult.zip" />
  <arg value="MyProject\bin\release\*.dll" />
 </exec>
 </target>

</project>

Anyway my working path is: C:\Programme\TeamCity\buildAgent\work

Malcolm Frexner
Reading about Artifact Paths it sounds like TeamCity is already kinda doing what I want to do and I only need to copy it's files. Thanks!
efdee
A: 

The $(teamcity_build_workingDir) property did it.

efdee