4 Replies Last post: Mar 31, 2009 9:53 AM by Hewie  
ycseattle Newbie 1 posts since
Mar 5, 2009
Currently Being Moderated

Mar 11, 2009 2:20 AM

How to deploy after TeamCity build?



I just get started to use TeamCity to build a continuous integration server. I am using Visual Studio 2008 Team System as our dev environment for a web application. The project also include the VSTS database edition.


How do I setup the TeamCity, so that after a successful build, I can deploy the web application (ASP.NET MVC) and the database to the same server or a remote server automatically and then run web UI tests (WatiN) and unit tests? I guess I can use XCOPY deployment for the web app, but I don't know where to configure the TeamCity. I am also not sure how to deploy a VSTS database project from TeamCity.




Yegor Yarko JetBrains 1,901 posts since
May 5, 2004
Currently Being Moderated
Mar 12, 2009 2:08 PM in response to: ycseattle
Re: How to deploy after TeamCity build?



TeamCity does not provide dedicated deployment tasks at this time, but you can create put your deployment logic into a new build and trigger it after successful completion of another build. The deployment build can then retrieve the artifacts to be deployed with the help of artifact dependency and do whatever deployment procedure requires it to do.


Best regards,


Yegor Yarko
Project Manager (TeamCity)
JetBrains, Inc
"Develop with pleasure!"

Neil Burnett Newbie 9 posts since
Feb 1, 2008
Currently Being Moderated
Mar 18, 2009 10:49 PM in response to: Yegor Yarko
Re: How to deploy after TeamCity build?

Great! Do you have a baby steps version of that for me to follow? I also want to build my wap project, tag it to the svn tags folder then deploy it to either our staging site or production site.

Lise Engmo Newbie 1 posts since
Mar 24, 2009
Currently Being Moderated
Mar 24, 2009 10:12 AM in response to: Neil Burnett
Re: How to deploy after TeamCity build?

An example of that would be very much appreciated by me too

Hewie Newbie 11 posts since
Oct 14, 2008
Currently Being Moderated
Mar 31, 2009 9:54 AM in response to: ycseattle
Re: How to deploy after TeamCity build?

Hi guys,


An example of how we do it is use a combination of psexec and nant scripts.  We deploy database changes via scripts which are not part of TeamCity (yet.. but it will be scripted at some point).  We create MSI installers using WiX (also scripted, and is passed as a parameter from teamcity to the nant script) of a .NET application, copy these MSI's to the remote server, then run them using psexec.  So to give you a rough idea of how we use psexec...


psexec -u [username] -p [password] -w [working directory] \\[server] -n [timeout] cmd [path\to\installer.msi] > nul


This will connect to the remote server using the directory you specify and run the installer.  Any output (eg. stderr, stdout) is redirected to a nul device (we've had inconsistent problems with psexec crashing when it gets output from a program).  The above also assumes that you have already copied the .msi file to the relevant directory.


This solution is by no means perfect, but it seems to work ok for us

More Like This

  • Retrieving data ...