Apr 8 2010

Team City basics for MSBuild and SVN

Category: zvolkov @ 12:24

Basic build process

  1. TeamCity retrieves sources from SVN to Build Check Out Directory. By default, TeamCity optimizes communication with SVN servers by retrieving only the necessary changes.  For more info on this read http://confluence.jetbrains.net/display/TCD5/VCS+Checkout+Mode and http://confluence.jetbrains.net/display/TCD5/Clean+Checkout
  2. TeamCity generates .proj file in the Build Temp Directory and executes MSBuild. This is where you can see every single parameter passed by TeamCity to MSBuild! The generated .proj file references the actual build script located in the Build Check Out Directory
  3. MSBuild executes actual build script. Current directory is set to Build Working Directory (which by default is same as the checkout dir), so this is what all relative paths start from.
  4. The script should output the binaries to a subfolder of Build Check Out Directory
  5. Artifacts produced by the build are picked up and uploaded to Team City Data Directory and made available for download via the Web UI. For more info see http://confluence.jetbrains.net/display/TCD5/Build+Artifact

Directories

  • Build Check Out Directory
    • Significance: contains source code for particular project. The binaries produced by the build should also go here.
    • Default: C:\BuildAgent\work\[hash code] -- The hash code is calculated based on SVN settings used by the build configuration. Effectively, this means that the directory is shared between all the build configurations with the same settings.
    • Property: $(teamcity_build_checkoutDir)
    • Documentation: http://confluence.jetbrains.net/display/TCD5/Build+Checkout+Directory
  • Build Temp Directory
    • Significance: stores MSBuild proj file and parameters generated by TeamCity; can be used to store other temp stuff; cleaned-up before every build.
    • Default: C:\BuildAgent\temp\buildTmp
    • Property: $(teamcity_build_tempDir)

If you want to give a direct link to a build artifact to somebody (e.g. for QA or deployment), you can use the following syntax:

http://<SERVER>/repository/download/<PROJECT>::<CONFIGURATION>/<BUILD_NUMBER>/<ARTIFACT_NAME>

For example:

http://rocktechtfsrep.tech.corp.local:81/repository/download/CDI 2.0::CDI Trunk/2.5.0.10/CDI2_TEMP.msi

Read this for more details: http://confluence.jetbrains.net/display/TCD5/Patterns+For+Accessing+Build+Artifacts

Tags:

Comments

Comments are closed