我们有一个现有的构建定义,它创建了一个命令文件“ToQA.cmd”,我们使用该文件将包从我们的集成服务器 ftp 到我们的 QA 服务器。虽然是命令文件,但不能直接双击执行脚本。我们必须导航到命令文件所在的文件夹,复制脚本并将其粘贴到命令提示符中以执行它。问题是当我们双击命令文件时,它在 c:\users\[userid] 下运行,显然该文件在该位置不存在并且它失败了。现在我正在尝试更新构建定义,以便它首先导航到命令文件所在的文件夹,如下所示:
cd c:\build\buildNumber 文件夹
powershell -文件 ftp.ps1 11.11.11.111 NewBuild.www_20140512.1
这是现有的构建定义:
<mtbwa:InvokeProcess FileName="cmd.exe" sap:VirtualizedContainerService.HintSize="200,184" WorkingDirectory="." DisplayName="Create the QA CMD file">
<mtbwa:InvokeProcess.Arguments>[String.Format("/C echo powershell -File ftp.ps1 11.11.11.111 {1} >{0}\{1}\toQA.cmd",BuildInstallFolder,BuildDetail.BuildNumber)]</mtbwa:InvokeProcess.Arguments>
<mtbwa:InvokeProcess.ErrorDataReceived>
<ActivityAction x:TypeArguments="x:String">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="x:String" Name="errOutput" />
</ActivityAction.Argument>
<mtbwa:WriteBuildError Message="[errOutput]" />
</ActivityAction>
</mtbwa:InvokeProcess.ErrorDataReceived>
<mtbwa:InvokeProcess.OutputDataReceived>
<ActivityAction x:TypeArguments="x:String">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="x:String" Name="stdOutput" />
</ActivityAction.Argument>
<mtbwa:WriteBuildMessage Importance="[Microsoft.TeamFoundation.Build.Client.BuildMessageImportance.High]" Message="[stdOutput]" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces" />
</ActivityAction>
</mtbwa:InvokeProcess.OutputDataReceived>
/mtbwa:InvokeProcess>
我试图回显新行,即回显。还使用了 && 符号,但没有帮助。我不是编写构建定义或批处理脚本方面的专家,所以想知道是否有人可以帮助我解决这个问题?
谢谢。