0
votes

I have built a new server with TeamCity v9.0. I am having difficulty trying to copy the build output to a mapped network drive X:.

My build steps are as follows:

  1. Get latest version from TFS online.
  2. Build using MSBuild
  3. Run NUnit tests
  4. Copy two folders (Web and ServiceLayer) to a mapped network drive X:

Attempted but can not get working:

  1. Created a final build step with the following Command Line script:

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

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

Error:

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\work\3b1161c630069aad 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. Created an artifact path

    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 Config\224\d:\Temp"

Question

Can someone please tell me how I can copy my ServiceLayer and Web folders to another directory when the build completes?

1

1 Answers

1
votes

I changed the source and destination paths and it copied the directories.

From

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

To

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