it:ad:webdeploy:howto:create_a_package:from_the_cli

IT:AD:WebDeploy:HowTo:Create a Package From The CLI

Summary

Using Visual Studio's button to create a package is fine for simple developer scenarios.

But not how one would do it from within a IT:AD:Continuous Integration scenario.

Use IT:AD:MSBuild to invoke IT:AD:MSBuild targets within:
* %ProgramFiles(x86)%\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets

  • and this file in turn imports

* %ProgramFiles(x86)%\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets

msbuild {solution file} 
    /p:CreatePackageOnPublish=[true|false] 
    /p:DeployOnBuild=true
    /p:DeployTarget=[MsDeployPublish|Package]
    # define the publish scenario to use
    /p:PublishProfile='Test.pubxml'
    #leave files on server after deployment
    /p:SkipExtraFilesOnServer=[true|false]   
    
    /p:DeployIisAppPath=<Web Site Name>/<Folder>
    /p:MsDeployServiceUrl=Location of MSDeploy installation you want to use
    # do not use the older RemoteAgent - stick with WMSVC
    # http://stackoverflow.com/questions/2636153/how-can-i-get-tfs2010-to-run-msdeploy-for-me-through-msbuild
    /p:MsDeployPublishMethod=[WMSVC|File|InProc]
    # used with self-signed SSL certificates:
    /p:AllowUntrustedCertificate=[true|false]
    /p:UserName
    /p:Password
    /p:DeployIisAppPath=staging.example.com   
    /p:MsDeployServiceUrl=https://staging.example.com:8172/msdeploy.axd 
    /p:IncludeIisSettingsOnPublish=[false|false]
    

  • Notes:
    • CreatePackageOnPublish:
    • DeployOnBuild:
      • MSDN Ref – no documentation!
      • if false, no Package is created
    • DeployIisAppPath:

In other words – to create a package, without deploying:

msbuild {solution file} 
    /p:CreatePackageOnPublish=true 
    /p:DeployOnBuild=true
    # define the publish scenario to use
    /p:PublishProfile='Test.pubxml'
    /p:DeployTarget=MsDeployPublish

Note:This only works if you have actually added to the Test.pubxml Publish Profile a WebDeploy Package (and not a WebDeploy)

msbuild {solution file} 
    /p:CreatePackageOnPublish=true 
    /p:DeployOnBuild=true
    /p:DeployTarget=Package
    # define the publish scenario to use
    /p:PublishProfile='Test.pubxml'

Note:This only works if you have actually added to the Test.pubxml Publish Profile a WebDeploy Package (and not a WebDeploy)

msbuild {solution file} 
    /p:CreatePackageOnPublish=true 
    /p:DeployOnBuild=true
    /p:DeployTarget=Package
    # define the publish scenario to use
    /p:PublishProfile='Test.pubxml'
    /p:PublishIISAppPath="Default Web Site/Test 6"

will create a new Virtual directory (test 6) under the web site.

Note:This only works if you have actually added to the Test.pubxml Publish Profile a WebDeploy Package (and not a WebDeploy)

If you want to build a project's package:

msbuild {project file} /t:Package

Ref: http://www.iis.net/learn/publish/using-web-deploy/building-a-web-deploy-package-from-visual-studio-2010

  • /home/skysigal/public_html/data/pages/it/ad/webdeploy/howto/create_a_package/from_the_cli.txt
  • Last modified: 2023/11/04 02:33
  • by 127.0.0.1