Patrick Lorio
Patrick Lorio

Reputation: 5668

Deployment with WebDeploy msbuild

My Goal: use webdeploy to deploy builds from TeamCity to remote IIS server

I am trying to figure out webdeploy but have had little luck. Currently to my understanding this is the work flow of webdeploy.

msbuild builds the project -> launches webdeploy tool -> sends data to remote IIS server.

I haven't seen any indication of this when building my project using paramaters. There is nothing in the build log to indicate that any deployment is going on.

C:\Windows\Microsoft.NET\Framework\v4.0.30319>msbuild \src\TestWebsiteApp\TestWe
bsiteApp.sln /p:Configuration=release /p:DeployOnBuild=True /p:DeployTarget=MSDe
ployPublish /p:MSDeployPublishMethod=RemoteAgent /p:MsDeployServiceUrl=localhost
 /p:username=myusername /p:password=mypassword

Could someone layout how webdeploy works and what are the requirements for it. What I've gathered is it needs msbuild v4.0 and IIS6 +

Any information / guidance would be much appreciated, thanks.

Upvotes: 1

Views: 1052

Answers (1)

pguzewicz
pguzewicz

Reputation: 304

I use Hudson but the principal for setting this up is the same. Once you figure out how to successfully deploy the package on to the server from your local machine the rest will be a piece of cake ;)

This will make you a package:

MSBuild "WcfService1.csproj" /T:Package

Then look for Package folder in your solution folder (should be in obj\debug). Inside you should see something like this:

PackageTmp
WcfService1.deploy-readme.txt
WcfService1.deploy.cmd
WcfService1.SetParameters.xml
WcfService1.SourceManifest.xml
WcfService1.zip

You need to have Web Deployment Tool installed on your server and Remote Agent Service running there as well (after you install WDT I think it's turned off). If you already have that, open windows console and run

WcfService1.deploy.cmd /M:your_server_name /Y

You can use /T instead of /Y to do a test run - nothing will be published but you'll see if you're missing anything.

Remember about your app pool identity, access to folders etc.

Those are just basic steps, for more advanced stuff you'll need to play a bit with SetParameters.xml file and/or with your project properties.

Upvotes: 1

Related Questions