Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MS Web Deploy Skip Delete Rule not skipping

I've added the following skip rule to my project but when I use Web Deploy to publish the contents, the files in the /config folder are being wiped out.

I'm using the process found here and I swear it was working previously.

I've added the following to my project file:

<PropertyGroup>
    <OnBeforePackageUsingManifest>AddCustomSkipRules</OnBeforePackageUsingManifest>
</PropertyGroup>
<Target Name="AddCustomSkipRules">
    <ItemGroup>
      <MsDeploySkipRules Include="SkipConfigFolder">
        <SkipAction>Delete</SkipAction>
        <ObjectName>dirPath</ObjectName>
        <AbsolutePath>.*\\config\\$</AbsolutePath>
        <XPath></XPath>
      </MsDeploySkipRules>
      <MsDeploySkipRules Include="SkipConfigSubFolders">
        <SkipAction>Delete</SkipAction>
        <ObjectName>dirPath</ObjectName>
        <AbsolutePath>.*\\config\\.*$</AbsolutePath>
        <XPath></XPath>
      </MsDeploySkipRules>  
    </ItemGroup>
</Target>

When I publish (via command-line using the cmd file generated by the package), the following is outputted:

-------------------------------------------------------
 Start executing msdeploy.exe
-------------------------------------------------------
 "C:\Program Files\IIS\Microsoft Web Deploy V2\\msdeploy.exe" 
   -source:package='<MyPackageFile>' 
   -dest:auto,includeAcls='False' 
   -verb:sync 
   -disableLink:AppPoolExtension 
   -disableLink:ContentExtension 
   -disableLink:CertificateExtension 
   -skip:skipaction='Delete',objectname='dirPath',absolutepath='.*\\config\\$' 
   -skip:skipaction='Delete',objectname='dirPath',absolutepath='.*\\config\\.*$' 
   -setParamFile:"<MySetParameters.xml>"
Info: Deleting filePath (Default Web Site/uPPK_32\config\New Text Document.txt).

It looks like the skip rule is being added but notice New Text Document.txt is being deleted. How can I prevent this? Am I missing something?

like image 361
Ben Ripley Avatar asked May 10 '12 14:05

Ben Ripley


1 Answers

I think your second skip line needs to use filePath instead of DirPath, as you're selecting files there.

like image 199
Paul Smith Avatar answered Sep 19 '22 22:09

Paul Smith