Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.