Breaking MsBuild package & deploy into separate MsBuild and MsDeploy commands

后端 未结 3 1650
被撕碎了的回忆
被撕碎了的回忆 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 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!

提交回复
热议问题