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.


Comment actions Permalink


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!"

Comment actions Permalink

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.

Comment actions Permalink

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

Comment actions Permalink

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


Please sign in to leave a comment.