I want MSDeploy to skip specific folders and file types in other folders when using synchronization. I am currently using CCNet to invoke MSDeploy using the sync verb to select websites from assembly to an intermediate server. Since the destination has files created by the application / user, downloaded files, etc., I need to exclude certain folders from the destination . There are also manifest files created by the site that should remain at the destination.
At the moment, I used -enableRule:DoNotDeleteRule , but this leaves the obsolete files in the destination.
<exec> <executable>$(MsDeploy)</executable> <baseDirectory>$(ProjectsDirectory)$(projectName)$(ProjectsWorkingDirectory)\Website\</baseDirectory> <buildArgs>-verb:sync -source:iisApp="$(ProjectsDirectory)$(projectName)$(ProjectsWorkingDirectory)\Website\" -dest:iisApp="$(website)/$(websiteFolder)" -enableRule:DoNotDeleteRule</buildArgs> <buildTimeoutSeconds>600</buildTimeoutSeconds> <successExitCodes>0,1,2</successExitCodes> </exec>
I tried using the skip operation, but ran into problems. I originally dropped the DoNotDeleteRule and replaced it with (several) skip
<exec> <executable>$(MsDeploy)</executable <baseDirectory>$(ProjectsDirectory)$(projectName)$(ProjectsWorkingDirectory)\Website\</baseDirectory> <buildArgs>-verb:sync -source:iisApp="$(ProjectsDirectory)$(projectName)$(ProjectsWorkingDirectory)\Website\" -dest:iisApp="$(website)/$(websiteFolder)" -skip:objectName=dirPath,absolutePath="assets" -skip:objectName=dirPath,absolutePath="survey" -skip:objectName=dirPath,absolutePath="completion/custom/complete*.aspx" -skip:objectName=dirPath,absolutePath="completion/custom/surveylist*.manifest" -skip:objectName=dirPath,absolutePath="content/scorecardsupport" -skip:objectName=dirPath,absolutePath="Desktop/docs" -skip:objectName=dirPath,absolutePath="_TempImageFiles"</buildArgs> <buildTimeoutSeconds>600</buildTimeoutSeconds> <successExitCodes>0,1,2</successExitCodes> </exec>
But this leads to the following:
Error: source (iisApp) and destination (contentPath) are not compatible for this operation.
Number of errors: 1.
So, I changed from iisApp to contentPath and instead of dirPath, absolutePath is just a Directory like this:
<exec> <executable>$(MsDeploy)</executable <baseDirectory>$(ProjectsDirectory)$(projectName)$(ProjectsWorkingDirectory)\Website\</baseDirectory> <buildArgs>-verb:sync -source:contentPath="$(ProjectsDirectory)$(projectName)$(ProjectsWorkingDirectory)\Website\" -dest:contentPath="$(website)/$(websiteFolder)" -skip:Directory="assets" -skip:Directory="survey" -skip:Directory="content/scorecardsupport" -skip:Directory="Desktop/docs" -skip:Directory="_TempImageFiles"</buildArgs> <buildTimeoutSeconds>600</buildTimeoutSeconds> <successExitCodes>0,1,2</successExitCodes> </exec>
and this gives me an error: Invalid characters in the path:
<buildresults>
Info: Add MSDeploy.contentPath (MSDeploy.contentPath).
Info: Adding contentPath (C: \ WWWRoot \ MySite
-skip: Directory = assets
-skip: Directory = overview
-skip: Directory = content / scorecardsupport
-skip: Directory = Desktop / documents
-skip: Directory = _TempImageFiles)
. Info: adding dirPath (C: \ WWWRoot \ MySite
-skip: Directory = assets
-skip: Directory = overview
-skip: Directory = content / scorecardsupport
-skip: Directory = Desktop / documents
-skip: Directory = _TempImageFiles)
. </buildresults>
<buildresults>
Error: Invalid characters in the path.
Number of errors: 1.
</buildresults>
So, I need to know how to configure this task so that the links to the folders are not deleted as a result of their synchronization and that the * .manifest and * .aspx files in the completion / user folders are also skipped.