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

£可爱£侵袭症+ 提交于 2019-12-11 16:47:32

问题


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?


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/14090567/not-include-certain-folders-in-a-continuous-deployment-with-tfs-skip-command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!