I am using msdeploy to publish on a remote server via teamcity. Problem is msdeploy doesn't delete files in IIS site directory prior to publish. Can any one tell how to delete file prior to publish using msdeploy or do I have to write a batch script to delete directory and then recreate it?
2 Answers
1
votes
see http://technet.microsoft.com/en-us/library/dd568992(WS.10).aspx for extra msdeploy rules which you can enable/disable. I think you need the 'DoNotDeleteRule' but i am not sure.
1
votes
For delete files in a folder, but don't delete folder i find a solution with sync functionality. I synced an empty folder with destination folder.
my command is:
msdeploy.exe -verb:sync -source:contentPath="path to empty folder here" -dest:contentPath="folder to cleanup",computerName=%msdeploy_Server_Url_here%?site=%IIS_Site_Name_here%,userName=%msdeploy_user_name_here%,password=%msdeploy_user_pwd_here%,authType=basic -allowUntrusted=true