本文介绍了用于跳过目录的 MSbuild 命令行参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在团队城市中有以下命令行参数进行部署.一切正常,但我想在部署时跳过一些目录.我如何在团队城市的 msbuild 脚本中添加该逻辑

I have following command line parameters in team city for deployment. everything works fine but i want to skip some directory while deployment. how can i add that logic in following msbuild script in team city

/P:Configuration=%env.Configuration%
/P:DeployOnBuild=True
/P:DeployTarget=MSDeployPublish
/P:MsDeployServiceUrl=https://%env.TargetServer%/MsDeploy.axd
/P:AllowUntrustedCertificate=True
/P:MSDeployPublishMethod=WMSvc
/P:CreatePackageOnPublish=True
/P:SkipExtraFilesOnServer=True
/P:UserName=xxxxx
/P:Password=xxxxx

推荐答案

我也在做同样的事情.我不喜欢修改我的 .csproj 文件,所以我尝试了这个.到目前为止,它对我有用.就我而言,我从部署中排除了媒体、App_DataLogs 和 App_Datapreview 文件夹,而不是 Data 文件夹.

I was working on the same thing. I didn't like having to modify my .csproj file, so I tried this. It is working for me so far. In my case, I was excluding the media, App_DataLogs, and App_Datapreview folders from deployment instead of the Data folder.

基本上,您可以将 ExcludeFoldersFromDeployment 作为参数传递给 MSBuild.将它与 SkipExtraFilesOnServer 结合使用就可以了.

Basically, you can pass the ExcludeFoldersFromDeployment as a parameter to MSBuild. Combining that with the SkipExtraFilesOnServer does the trick.

/p:Configuration=Debug
/p:DeployOnBuild=True
/p:DeployTarget=MSDeployPublish
/p:MsDeployServiceUrl=OurDevWebServer/msdeployagentservice
/p:AllowUntrustedCertificate=True
/p:MSDeployPublishMethod=RemoteAgent
/p:CreatePackageOnPublish=True
/p:DeployIisAppPath=umbraco_TestSite
/p:IgnoreDeployManagedRuntimeVersion=True
/p:SkipExtraFilesOnServer=True
/p:ExcludeFoldersFromDeployment="media;App_DataLogs;App_Datapreview"
/p:IncludeSetAclProviderOnDestination=False
/p:AuthType=NTML /p:UserName=

这篇关于用于跳过目录的 MSbuild 命令行参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 18:10