TFS 实验室管理部署脚本 [英] TFS Lab management Deployment Scripts

查看:27
本文介绍了TFS 实验室管理部署脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用构建-部署-测试工作流程使用 TFS 2012 设置标准实验室环境.我设置了测试控制器和测试代理,但是当 LabManagement 工作流开始执行时,我在 RunDeploymentTask 活动中遇到异常

I'm trying to setup Standard Lab Environment with TFS 2012 utilizing Build-Deploy-Test workflow. I setup test controller and test agents but when the LabManagement workflow starts executing I get an exception on RunDeploymentTask activity

Initial Property Values
BuildLocation = \\S0503TFS2T\TFSPlayground\ConsoleApplicationBuild\ConsoleApplicationBuild_20121210.23
DeploymentScriptDetails = agent1 | "$(BuildLocation)\Deploy.bat" $(BuildLocation) | c:\Env
LabEnvironmentUri = vstfs:///LabManagement/LabEnvironment/4
MaxWaitTime = 00:30:00
ThrowOnError = True
UseRoleForDeployment = True
Deployment Task Logs for Machine: win7testagent1
 Access is denied
 Exception Message: Team Foundation Server could not complete the deployment task for machine 'win7testagent1', script '"\\S0503TFS2T\TFSPlayground\ConsoleApplicationBuild\ConsoleApplicationBuild_20121210.23\Deploy.bat"', arguments '\\S0503TFS2T\TFSPlayground\ConsoleApplicationBuild\ConsoleApplicationBuild_20121210.23' and working directory 'c:\Env'. (type LabDeploymentProcessException)
Exception Stack Trace: 
Server stack trace: 
   at Microsoft.TeamFoundation.Lab.Workflow.Activities.RunDeploymentTask.ExecuteDeploymentTask.RunCommand(AsyncState state)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)
   at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)
   at System.Action`1.EndInvoke(IAsyncResult result)
   at Microsoft.TeamFoundation.Lab.Workflow.Activities.RunDeploymentTask.ExecuteDeploymentTask.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
   at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

显然,这是安全问题,我无法克服它以下是 MSDN 对这个过程的解释:

Apparently, this is security issue, that i cannot get over it Here's how this process is explained by MSDN:

构建-部署-测试工作流开始构建,然后获取部署脚本.构建定义将构建文件复制到放置位置.工作流在脚本分配到的特定机器或机器角色的工作目录中运行每个部署脚本.每个部署脚本从放置位置检索构建文件.每个部署脚本将指定的构建文件复制或安装到实验室环境中的机器上.

此时问题出现 - 工作流在特定机器的工作目录中运行每个部署脚本.

两台机器都在同一个域中,运行构建服务的用户也在远程机器的管理员组中.我什至与网络中的每个人共享了工作流应该在其中复制文件/脚本的远程文件夹,但再次没有运气.

Both machines are in the same domain the user that runs the Build service is also in the administrators group in the remote machine. I have even shared the remote folder where the workflow is supposed to copy the files/script with everyone in the network but no luck again.

我正在做一些让我发疯的蠢事 - 非常感谢任何帮助或想法!

I'm doing something stupid that driving me crazy - any help or thoughts are greatly appreciated!

最好的,雷达

推荐答案

您可以尝试在 bat 脚本的最后检查 %ErrorLevel%.我也遇到了同样的错误,原来那个错误是由robocopy的退出码引起的,复制成功时返回1.我将错误代码设置为 0,问题已解决.

You may try to check %ErrorLevel% at the last of your bat script. I met the same error, and it turned out that that error was caused by exit code of robocopy, which returns 1 when the copy successes. I set the error code to 0, the issue was fixed.

这篇关于TFS 实验室管理部署脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆