2017-02-21 66 views
0

我正在使用TeamCity使用Nant構建CI。我堅持使用最後一段代碼來部署到服務器時排除App_Data文件夾。這裏是我的代碼:如何使用msdeploy.exe排除Web Deploy V3 cmd行中的文件夾

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. 

什麼,我在此代碼做錯了任何幫助將是一個很大的幫助。

回答

0

配置(添加換行以提高可讀性):

-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 

其中tfs.skip.directory-->\\App_Data Configuration parameter

相關問題