我一直在关注自动化部署和测试的标准环境,但遇到了一些错误。
我有两台服务器,一台Windows Server 2008 R2和另一台Windows Server 2012。在我已经安装Web Deploy 3
并且服务Web Deployment Agent Service
在两台机器上运行。我在我的域中有服务帐户,并将两台机器上的帐户添加到管理员组。我还将这个帐户用于构建和测试控制器和代理。
2008服务器是构建服务器,我想将一个带有构建服务器的网站部署到2012服务器。我有一个构建定义,它deploy.cmd
使用标准TFS 2012 Update 2过程模板(/p:DeployOnBuild=True
作为 MS 构建参数添加)制作带有 zip 等的包。
我有另一个基于 LabDefaultTemplate TFS 2012 update 2 模板的构建定义。在实验室流程模板中,我在部署选项卡上添加了以下命令:
"$(BuildLocation)\_PublishedWebsites\UI.Web.Mvc4_Package\UI.Web.Mvc4.deploy.cmd" /y /m:SERVERNAME_OF_THE_2012_SERVER
当我运行第二个构建定义时,我收到“拒绝访问”错误。我不知道它是从哪里来的。我没有看到这里发生任何特别的事情。我还将日志设置为诊断,但这不起作用。
当我将远程桌面连接到 2008 构建服务器并手动运行时deploy.cmd
,一切正常。该站点部署在 2012 服务器上,并且一切都在运行。
有人能帮我吗?
谢谢
从构建中添加日志:
Deploy Build on Environment
00:22
Deploying Build
00:22
Run Deployment scripts
Initial Property Values
Values = Web Server | $(BuildLocation)\_PublishedWebsites\UI.Web.Mvc4_Package\start.bat
00:22
Run Deployment Task
Initial Property Values
BuildLocation = \\AP-GDA06-TFSB\DropFolder\Dev MVC4\Dev MVC4_20130510.11
DeploymentScriptDetails = Web Server | $(BuildLocation)\_PublishedWebsites\UI.Web.Mvc4_Package\start.bat
LabEnvironmentUri = vstfs:///LabManagement/LabEnvironment/3
MaxWaitTime = 00:30:00
ThrowOnError = True
UseRoleForDeployment = True
Deployment Task Logs for Machine: 2012_SERVER
Access is denied
Exception Message: Team Foundation Server could not complete the deployment task for machine '2012_SERVER', script '\\2008_SERVER\DropFolder\Dev MVC4\Dev MVC4_20130510.11\_PublishedWebsites\UI.Web.Mvc4_Package\start.bat' and arguments ''. (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)
Final Property Values
BuildLocation = \\2008_SERVER\DropFolder\Dev MVC4\Dev MVC4_20130510.11
DeploymentScriptDetails = Web Server | $(BuildLocation)\_PublishedWebsites\UI.Web.Mvc4_Package\start.bat
LabEnvironmentUri = vstfs:///LabManagement/LabEnvironment/3
MaxWaitTime = 00:30:00
ThrowOnError = True
UseRoleForDeployment = True
Final Property Values
Values = Web Server | $(BuildLocation)\_PublishedWebsites\UI.Web.Mvc4_Package\start.bat
启动的 BAT 文件包含以下命令:
START UI.Web.Mvc4.deploy.cmd /y /m:2012_SERVER