runCommand provider in msdeploy's Manifest.xml file

六月ゝ 毕业季﹏ 提交于 2019-12-10 10:54:04

问题


I am trying to include running a batch script (more, provided I can figure this out) as part of the deployment process via msdeploy by using the runCommand provider in the manifest file.

This is what my manifest file looks like

<MSDeploy.iisApp>
  <iisapp path="Default Web Site/SiteName" />

  <dbfullSql path="msdeploy.config" transacted="false" />
  ...(more calls to providers)

  <runCommand path="(call to batch script here)" />
</MSDeploy.iisApp>

Everything in the manifest file runs fine, but it doesn't look like my command is actually running. A log of the outputs gives me this at the end where my command should have been called.

Info: Adding child runcommand (MSDeploy.iisApp/runCommand).
Verbose: The synchronization completed in 1 pass(es).
Total changes: 85 (82 added, 3 deleted, 0 updated, 0 parameters changed, 0 bytes copied)

I use the following command to run msdeploy:

"C:\Program Files\IIS\Microsoft Web Deploy\msdeploy.exe" -verb:sync -source:package="package" -dest:iisApp="Default Web Site/SiteName" -setParam:name=bunch of parameters... -debug -verbose > MsDeployOutput.txt

The command I give to the manifest file (which is also in my source package) is recognized (in whatever way that may be) but never executed. Any ideas as to the cause and the solution?


回答1:


MsDeploy also has an auto provider which deploys the content of the package. So you will have to change your commandline to be

"C:\Program Files\IIS\Microsoft Web Deploy\msdeploy.exe" -verb:sync -source:package="package" -dest:auto -setParam:name=bunch of parameters... -debug -verbose > MsDeployOutput.txt

Also, if you want your manifest to kick in, you need to modify your commandline as

"C:\Program Files\IIS\Microsoft Web Deploy\msdeploy.exe" -verb:sync -source:package="package" -dest:manifest="manifestLocation" -setParam:name=bunch of parameters... -debug -verbose > MsDeployOutput.txt

and MsDeploy will do its magic.

Thanks,




回答2:


There is a bug in runCommand provider. To workaround it, use this attribute MSDeploy.MSDeployKeyAttributeName="path"

Like this: <runCommand path="(call to batch script here)" MSDeploy.MSDeployKeyAttributeName="path" />



来源:https://stackoverflow.com/questions/1511792/runcommand-provider-in-msdeploys-manifest-xml-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!