【问题标题】:WebDeploy 3.0 RunCommand executes too soon via WebDeploy agentWeb Deploy 3.0 运行命令通过 WebDeploy 代理执行得太快
【发布时间】:2014-01-13 05:27:37
【问题描述】:

我正在使用带有清单文件的 WebDeploy 3.0,其中包含 contentPathrunCommand

<siteManifest>
  <contentPath path="C:\Test\Path" />
  <runCommand path="echo hello" />
</siteManifest>

我遇到了一个问题,即 runCommandcontentPath 提供程序同步文件(仅目录)之前执行 - 并且仅在通过代理从远程计算机执行时才执行。

以下是直接通过WebDeploy执行时的输出:

Info: Using ID 'xxx' for connections to the remote server.    
Info: Adding siteManifest (siteManifest).
Info: Adding virtual path (C:\Test\Path)
Info: Adding file (C:\Test\Path\File)
Info: Updating runCommand (echo hello).
Info: hello
Info: The process 'C:\Windows\system32\cmd.exe' (command line '') exited with code '0x0'.

以下是通过 WebDeploy 代理执行时的输出:

Info: Using ID 'xxx' for connections to the remote server.    
Info: Adding siteManifest (siteManifest).
Info: Adding virtual path (C:\Test\Path)
Info: Updating runCommand (echo hello).
Info: hello
Info: The process 'C:\Windows\system32\cmd.exe' (command line '') exited with code '0x0'.
Info: Using ID 'xxx' for connections to the remote server.
Info: Adding file (C:\Test\Path\File)

知道如何在使用 WebDeploy 代理时阻止contentPath 之前发生的RunCommand 吗?

【问题讨论】:

  • 你能澄清一下“网络部署代理”吗?您是指 MSDeploy 代理服务(需要管理员用户)还是 Web 管理服务(msdeploy.axd,不需要管理员用户)? (另外,嘿迈克!)
  • 我的意思是我相信的 MSDeploy 代理服务(嘿 Rich!)。

标签: msdeploy webdeploy


【解决方案1】:

听起来这与远程执行所经历的提交阶段有关。虽然我无法提供直接的解决方案,但您是否考虑过将您的 runCommand 移至 postSync

msdeploy -verb:sync ^
         -source:manifest=manifest.xml ^
         -dest:auto,computerName=... ^
         -postSync:runCommand="echo hello"

【讨论】:

  • 感谢 Richard :) 出于各种兼容性原因,我们希望通过清单文件而不是命令行执行命令。看起来 postSync 是目前唯一的选择。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-11-11
相关资源
最近更新 更多