TeamCity Builds and SVN Tagging

Hi,
 
We have been using TeamCity for a few years and it’s been fantastic.  We are in the process of formalizing our build/release processes all the way down to the SVN repo.
 
I was wondering if anyone has specific inputs regarding TeamCity and SVN wrt to automatic tagging.
 
At present we are looking to setup a build configuration model for each project which looks a bit like so:
 
1. Build - (Performs the Compile), this is a VS* job runner.
 
2. Deploy 1. Hot - (Performs the deployment of the latest successfully Build (1) to the hot build environment).  (NANT runner)
3. Deploy 2. UAT - (Performs the deployment of a specific build number of Build (1) to the UAT environment) AND tags SVN artifacts (including SVN externs) with the UAT release tag  (NANT runner)
4. Deploy 3. Staging - (Performs the deployment of a specific build number of Build (1) to the live data proofing environment) AND tags SVN artifacts (including SVN externs) with the STAGING release tag (NANT runner)
5. Deploy 4. Live - (Performs the deployment of a specific build number of Build (1) to the live customer facing environment) AND tags SVN artifacts (including SVN externs) with the Live release tag. (NANT runner).
 
 
1. Is triggered when ever source is checked into SVN
2. Is triggered when ever the dependency 1, is changed
 
3. - 5.  Are all run manually and target a specific version of the Build dependency
 
 
Now team city has a couple of features for labelling
 
1. VCS labelling mode under the Version Control Settings
2. Under change to label manually.
 
However since we want to label specific Build artifacts when 2.-5. runs will we be able to make use of the VCS labelling mode under Teamcity?
 
The other idea I've had is we combine the Build and Deploy steps into each Build Configuration, I can see other advantages to this such as being able to perform debug builds vs. optimized builds.
 
1. Build & Deploy 1. Hot - (Performs the build and deployment to the hot build environment).  (NANT runner)
2. Build & Deploy 2. UAT - (Performs the build and deployment to the UAT environment AND tags SVN artifacts (including SVN externs) with the UAT release tag  (NANT runner)
3. Build & Deploy 3. Staging - (Performs the build and deployment to the live data proofing environment AND tags SVN artifacts (including SVN externs) with the STAGING release tag (NANT runner)
4. Build & Deploy 4. Live - (Performs the build and deployment of a specific build number of Build (1) to the live customer facing environment) AND tags SVN artifacts (including SVN externs) with the Live release tag. (NANT runner).
 
 
Any advice or best practices would be appreciated.
 
Philip

1 comment
Comment actions Permalink

Hello Philip,

  To use TeamCity VCS labeling, your build configuration should include VCS roots you want to label.

  So, if you want to label VCS roots in your "Deploy" configurations, they should include the same VCS settings as your "Build" configurations.

  You can reuse artifacts prepared in your "Build" configurations for deployment, for this, you should setup snaphot dependency from Deploy to Build + add artifact dependency. This way, you'll ensure that VCS label you put in Deploy configuration will be put exactly to the same version of sources as built in "Build" configuration.

  Not sure if it makes sense for you to prepare an optimized version of "Build" configuration for Deployments - but it is also possible.
  Personally, I don't think it worth joining Build and Deployment configurations into one - I think it is better to reuse artifacts.

  Another thing - if automatic TC labeling won't work for you, you can use "checkout on agent" option and add SVN labeling commands to you Deploy build configurations. In this setup, you'll have working SVN copy of sources on your build agent with .svn folders.
  So, you'll have semi-auto mode of source labeling - it will be done in your build script, but you'll have to write labeling commands for the script yourself.

  Hope this helps,
  KIR

0

Please sign in to leave a comment.