Web部署3.0运行命令通过Web Deploy代理执行太快

时间:2014-01-09 12:51:40

标签: msdeploy webdeploy

我正在使用带有清单文件的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代理时,是否知道如何在RunCommand之前停止发生contentPath

1 个答案:

答案 0 :(得分:1)

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

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