仅使用 MSTest 代理在远程系统上从 TFS 构建工作流运行部署脚本
我的问题:如何在仅运行 MSTest 代理的远程系统上从 TFS 2010 构建模板运行部署脚本?
我知道这可以通过激活测试设置配置文件中的部署部分来完成,但这不够灵活。晚上会运行构建。构建成功后,部署脚本将放置在放置位置。放置位置特定于日期、项目和构建定义。这些参数在我们使用的 TFS 构建模板中可用。
我没有可用的实验室管理,只有物理服务器。我宁愿不使用额外的构建代理来破坏物理服务器,只进行部署。 MSTest 代理显然能够运行部署脚本,但我如何使用 TFS 构建工作流程中的该功能。例如,我可以在没有实验室管理的情况下使用 RunDeploymentScript 活动吗?
My Question: How can I run a deployment script from the TFS 2010 build template on a remote system that has only a MSTest agent running?
I know this can be done by activating the Deployment section in the test settings configuration file, but this is not flexible enough. At night a build runs. When the build is successful, a deployment script is placed at a drop location. The drop location is date, project and build definition specific. These parameters are available in the TFS build template we use.
I do not have Lab Management available, just a physical server. I would rather not spoil the physical server with an additional build agent to only do the deployment. The MSTest agent is apparently capable of running deployment scripts, but how do I use that functionality from the TFS build workflow. For example, can I use the RunDeploymentScript activity without having Lab Management?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
PSExec 是一个在远程计算机上运行脚本的好工具。我在 Team Deploy 中使用它,它允许您从 Team Build 在远程计算机上安装 MSI。您还可以在远程计算机上运行 PowerShell,但设置稍微复杂一些。另一种选择是使用 MSDeploy。有一个命令选项,您可以在远程计算机上运行任何命令。我通常使用 InvokeProcess 活动来调用构建服务器上的 PowerShell 脚本。在 PowerShell 脚本中,我调用了 MSDeploy 以在目标服务器上运行远程 PowerShell 脚本。听起来很糟糕,但效果很好。
您无法在目标计算机上运行 RunDeploymentScript。您可以使用修改后的模板部署到物理环境。 这是一个很好的关于这样做的帖子。。我上面提到的选项不需要任何代理就可以了。您可以在没有实验室管理的情况下使用 ExecuteRemoteTestRun 实验室管理活动,通过测试代理和注册到项目集合(测试管理器)的测试控制器来运行 MTM 测试。
如果您对这些选项有任何疑问,请告诉我。
PSExec is a great tool for running scripts on remote computers. I use this in Team Deploy that allows you to install MSIs on remote computers from Team Build. You can also run PowerShell on remote computers but it is a little more complicated to set up. Another option is to use MSDeploy. There is a command option that you can run any command on a remote computer. I usually use an InvokeProcess activity to call a PowerShell script on the build server. From the PowerShell script I have called MSDeploy to run a remote PowerShell script on a target server. It sounds bad but worked good.
You can't run the RunDeploymentScript on the target machine. You can use a modified template to deploy to a physical environemnt. Here is a good post on doing this.. The options I mentioned above do not need any agent on it. You can use the ExecuteRemoteTestRun lab management activity without Lab Management to run the MTM Tests with the Test Agent with a Test Controller that is registered to the project collection (Test Manager).
Let me know if you have any questions on any of these options.