0

Using Team Foundation Server continuous deployment with Web Depoly, is it possible to stop certain folders being deployed? And if it is, how?

UPDATE You can't specify a skip rule via the command line (as in, an MSBuild Argument) because they are declared as items, not properties.

A skip command can be specified in a publish profile. However it seems publish profiles are only for the inbuilt publishing in visual studio, not Web Deploy 3.

Is there a way for Web Deploy to accept a publish profile, and if there is, should this be checked into TFS?

Community
  • 1
  • 1
marvc1
  • 3,641
  • 3
  • 25
  • 34

2 Answers2

2

It sounds like you are confusing the MSDeploy command line with executing MSBuild via the command line.

If you are executing msdeploy.exe or the generated deploy.cmd file, MSBuild doesn't even come into it and you are free to use the MSDeploy Skip Command (you can append additional command line arguments to the cmd call and they will be passed to msdeploy.exe).

If you are using MSBuild + "DeployOnBuild" or MSBuild + publish profiles you will need to declare your skip requirements as MsDeploySkipRules items. If you're building your package separately before this point and want to deploy it, you're going to run into some roadblocks.

Community
  • 1
  • 1
Richard Szalay
  • 83,269
  • 19
  • 178
  • 237
  • Thank you for your reply. I am using the second option: TFS build definitions (MSBuild.exe on TFS agent server) with DeployOnBuild pointing at Web Deploy service on hosting server. I will have detailed look at your answer in the other question. – marvc1 Jan 04 '13 at 15:44
  • 1
    Yes this is correct. For TFS follow these steps: 1. Create a publish profile in VS 2. Edit the .pubxml file to add the skip directives 3. Check in the files 4. Create a new build definition and pass in the following for MSBuild args /p:DeployOnBuild=true /p:PublishProfile= /p: and any other properties you need. – Sayed Ibrahim Hashimi Jan 04 '13 at 19:11
  • @marvc1 - If you are using MSBuild, you can use publish profiles (assuming you're running VS2012 or VS2010 + Azure SDK), so declaring an item won't be a problem. – Richard Szalay Jan 05 '13 at 01:31
  • @SayedIbrahimHashimi thank you, that was the solution I needed. – marvc1 Jan 07 '13 at 16:30
0

I also had the same issue, however found that there is switch you can use that does not require a profile. Having said that, a profile has other benefits. Here is the argument I used that works

/p:SkipExtraFilesOnServer=true

Jason A
  • 1
  • 1