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:
- Get latest version from TFS online.
- Build using MSBuild
- Run NUnit tests
- Copy two folders (Web and ServiceLayer) to a mapped network drive
X:
Attempted but can not get working:
- 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
- Created an artifact path
ServiceLayer => d:\Temp\x.zip
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?