Breaking MsBuild package & deploy into separate MsBuild and MsDeploy commands

后端 未结 3 1652
被撕碎了的回忆
被撕碎了的回忆 2021-01-31 06:37

I\'m having a few problems breaking out an MsBuild package+deploy command into two separate commands. (I need to do this to pass additional parameters to MsDeploy).

The

相关标签:
3条回答
  • 2021-01-31 06:44

    Add a delegation rule on the server using inetmgr to allow staging-deploy to carry out set-Acl operations. Inetmgr -> Click on server node -> Management Service Delegation (in Management) -> Click Add rule to the right -> Choose the template labelled "Set Permissions for Applications" -> Accept defaults and click OK.

    This should let you deploy any package or manifest with setAcl as long as the user you are deploying as, has permissions to the site you are deploying to.

    0 讨论(0)
  • 2021-01-31 06:54

    You are able to specify the -setParam:name='',value='' flag when calling the MyProject.deploy.cmd file that is created when you generate a Package from a web project. The cmd is a friendly wrapper around msdeploy.exe, so you have no need to specify all the rest of the defaults.

    Here's the details: http://evolutionarydeveloper.blogspot.co.uk/2013/05/specifying-environment-variables-at.html

    0 讨论(0)
  • 2021-01-31 07:01

    I've got this fixed now - I needed a different command to the one the automatically generated .cmd file was using, but comparing the two allowed me to fix it up (thanks @Vishal R. Joshi)

    The differences I needed was:

    • basic authentication
    • allow untrusted certificates
    • ?site=staging.webserver on the end of the MsBuild.axd path, as with my original command
    • override the IIS Web App name that is set in the params file
    • enable the do not delete rule

    The winning command is as follows:

    msdeploy 
     -verb:sync 
     -allowUntrusted 
     -source:package='src\WebProject\obj\Deploy-Staging\Package\WebProject.zip'  
     -dest:auto,ComputerName=
      'https://192.168.0.1:8172/MsDeploy.axd?site=staging.website.com',
      username='staging-deploy',password='xyz',authType='basic',includeAcls='false'
      setParamFile:
        "src\WebProject\obj\Deploy-Staging\Package\WebProject.SetParameters.xml"
     -setParam:name='IIS Web Application Name',value='staging.website.com'
     -enableRule:DoNotDeleteRule
     -disableLink:AppPoolExtension -disableLink:ContentExtension 
     -disableLink:CertificateExtension
    

    Hope this helps someone!

    0 讨论(0)
提交回复
热议问题