How to exclude folder in Web Deploy V3 cmd line using msdeploy.exe

耗尽温柔 提交于 2021-02-08 06:35:37

问题


I am in the process of building CI using TeamCity using Nant. I have stuck with the last piece of code to exclude App_Data folder while deploying to the server. Here is my code :

C:\Program Files\IIS\Microsoft Web Deploy V3>msdeploy.exe 
-verb:sync 
-source:contentPath="C:\a\testteamcity\Demo\WebApp\obj\Release\Package\PackageTmp"  
-dest:contentPath='prod.test/deploy'
-skip:Directory="App_Data" -skip:objectName=dirPath,absolutePath="\\App_Data"
,ComputerName="https://XXX:8172/msdeploy.axd?prod.
test",UserName='XXX\abc',Password=****',AuthType='Basic' 
-allowuntrusted -usechecksum 



Error: Unrecognized skip directive 'Directory'. Must be one of the following: "objectName," "keyAttribute," "absolutePath," "xPath," "attributes.<name>."
Error count: 1.

what I am doing wrong in this code Any Help would be a great help.


回答1:


Configuration (line breaks added for readability):

-verb:sync 
-source:contentPath="D:\Releases\1.107.1323" 
-dest:contentPath='%system.website%',
      ComputerName="%system.computername%%system.226.website%",
      UserName='%system.un%',
      Password='%system.pw%',
      AuthType="Basic" 
-skip:Directory="%tfs.skip.directory%" 
-EnableRule:DoNotDeleteRule 
-allowuntrusted 
-usechecksum

where tfs.skip.directory -->\\App_Data Configuration parameter



来源:https://stackoverflow.com/questions/42364982/how-to-exclude-folder-in-web-deploy-v3-cmd-line-using-msdeploy-exe

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