Configure TeamCity MSBuild and MSDeploy

I am having problems setting various parameters using MSBuild and MSDeploy.

I have 2 configurations in TeamCity

  • TestConfiguration (this creates the application in Test Config and runs unit tests)
  • StagingConfiguration (designed for packaging and deployment in our intermediate UA testing field)

My TestConfiguration works fine, but StagingConfiguration does not deploy the package.

<MSBuild Projects="MyProject\MyProject.csproj" Properties="Configuration=Staging; DeployOnBuild=true; DeployTarget=Package;"/> 

I tried adding both

 _PackageTempDir=\\server\c$\WebDirectory; PackageLocation=\\server\c$\WebDirectory; 

But it looks like I'm not doing anything, am I missing the point? I really couldn't find any documentation, just an odd blog post here and there. Do I need to install something on my TeamCity server for MSDeploy to work?

My perfect scenario:

  • Go to tfs
  • Launch StagingConfiguartion in TeamCity Manually
  • Code is created and deployed to \ server \ c $ \ WebDirectory
+8
msbuild teamcity msdeploy
source share
2 answers

You need to configure TeamCity System Properties, which will be passed to MsBuild and manage the MsDeploy pipeline. It's a little tricky to set up correctly, but the ones you need to install are:

  • system.CreatePackageOnPublish = true
  • system.DeployOnBuild = true
  • Systen, DeployTarget = MSDeployPublish
  • system.MSDeployPublishMethod = WMSvc
  • system.DeployIISAppPath = [Default website]
  • system.MSDeployServiceUrl = [yourServerDomainName]
  • system.Username = [username]
  • system.Password = [password]

I wrote a blog article in more detail: Deploying Web (MS Deploy) from TeamCity - http://www.geekytidbits.com/web-deploy-ms-deploy-from-teamcity/

This is what my config looks like: enter image description here

+4
source share

If Visual Studio is not installed on the build server (which, of course, should not be), you need several files from your dev machine to do everything:

In the C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0 on your development computer, copy the Web and Web Applications folders to the equivalent directory on your build server.

(from MSBuild target package not found )

+3
source share

All Articles