0

I'm using MSDeploy to create an artefact as a build step in NAnt. This particular build step is called on successful compilation. The artefact is then used to for deployment.

Here is the step specified in my build file.

  <target name="BuildMsDeployPackage" depends="StageForMsDeployPackaging">
    <exec program="${msdeploy.exe}"
          workingdir="${buildDirectory}"
          verbose="true"
          commandline="-verb:sync 
                      -source:iisapp=${packagingDirectory} 
                      -dest:package=${publishDirectory}\${webapp.artifact.zip}"/>

The source here is my my web project.

I want to be able to set specify write access to a couple of folders in the package that is created. Is this possible? I know that there is a setAcl provider for this specific purpose, but can this be used while creating a package?

bala_88
  • 101
  • 1

1 Answers1

0

You can use the manifest provider to include multiple providers in a sync, which will work with the package:

msdeploy verb:sync -source:manifest=manifest.xml -dest:package=package.zip
msdeploy verb:sync -source:package=package.zip -dest:auto,computerName=...

Then manifest.xml is:

<multipleAcls>
    <iisApp path="local iis app or path" />
    <setAcl path="remote iis site name/relative path1" setAclAccess="Write" />
    <setAcl path="remote iis site name/relative path2" setAclAccess="Read" />
</multipleAcls>

You can use parameters or replace statements on the dest:package call to avoid having to dynamically generate the manifest, and you can use similar statements on the deploy call to change which site/path you're deploying to. You can set your dest to a different manifest file as an alternative solution to the latter problem.

Richard Szalay
  • 306
  • 3
  • 11