Not include certain folders in a continuous deployment with TFS (Skip Command?)
Asked Answered
W

2

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?

Wivinia answered 30/12, 2012 at 12:5 Comment(1)
See my comment in Richards answerCataclysm
P
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.

Pagandom answered 3/1, 2013 at 22:38 Comment(4)
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.Wivinia
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=<name-of-profile> /p:<password> and any other properties you need.Cataclysm
@Wivinia - 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.Pagandom
@SayedIbrahimHashimi thank you, that was the solution I needed.Wivinia
G
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

Grison answered 19/6, 2013 at 19:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.