使用命令行或工件从成功构建复制文件时出错

Error copying files from successful build using command line or artifact

我用 TeamCity v9.0 构建了一个新服务器。我在尝试将构建输出复制到映射网络驱动器时遇到困难 X:

我的搭建步骤如下:

  1. 从 TFS 在线获取最新版本。
  2. 使用 MSBuild 构建
  3. 运行 N单元测试
  4. 将两个文件夹(Web 和 ServiceLayer)复制到映射的网络驱动器 X:

已尝试但无法开始工作:

  1. 使用以下 Command Line 脚本创建了最终构建步骤:

xcopy %system.teamcity.build.workingDir%\ServiceLayer\ D:\ServiceLayer\ /S /Y

xcopy %system.teamcity.build.workingDir%\Web\ D:\Web\ /S /Y

错误:

Step 4/5: Copy build output to web and api on staging (Command Line)

teamcity[buildStatisticValue key='buildStageDuration:firstStepPreparation' value='70.0']

teamcity[buildStatisticValue key='buildStageDuration:buildStepRUNNER_8' value='0.0'] Starting:

D:\TeamCity\buildAgent\temp\agentTmp\custom_script9113406165823545108.cmd

in directory: D:\TeamCity\buildAgent\workb1161c630069aad 0 File(s)

copied Invalid path Process exited with code 4

teamcity[buildStatisticValue key='buildStageDuration:buildStepRUNNER_8' value='194.0'] Step Copy

build output to web and api on staging (Command Line) failed

  1. 创建了工件路径

    ServiceLayer => d:\Temp\x.zip

Error:

Failed to publish artifacts: Failed to upload artifact, due to error:

java.io.IOException: Failed to create directory:

"C:\ProgramData\JetBrains\TeamCity\system\artifacts\ChannelOptimiser40\CO40 Build Config4\d:\Temp"

问题

谁能告诉我如何在构建完成后将 ServiceLayerWeb 文件夹复制到另一个目录?

我更改了源路径和目标路径,它复制了目录。

来自

xcopy %system.teamcity.build.workingDir%\ServiceLayer\ D:\ServiceLayer\ /S /Y

xcopy ServiceLayer \SomeNetworkPC\Site\ServiceLayer\ /S /Y