RoboCopy + Atlassian Bamboo Continuous Integration
-
26-12-2019 - |
質問
I've created a task to move my files to another server inside Bamboo using robocopy.
${bamboo.build.working.directory}\target\ \\DEVARCHER\inetpub\wwwroot\mywebsite\ /IS /MIR
However, when I do this robocopy returns the wrong code that is expected:
build 10-Jan-2014 13:41:56 Ended : Fri Jan 10 13:41:56 2014
simple 10-Jan-2014 13:41:56 Failing task since return code of
[C:\windows\system32\robocopy C:\bamboo-home\xml-data\build-dir\PHX-PL-JOB1\target\ \\DEVARCHER\inetpub\wwwroot\phoenix\ /IS /MIR]
was 1 while expected 0
Okay so I read somewhere else to return EXIT /B 0
but then robocopy ONLY moves folders and not files. Anyone got any ideas why?
解決
Changing the task to a 'script' and then inserting the following allowed my to be able to wrap the robocopy statement in params which was causing the problem. End result:
(C:\windows\system32\robocopy ${bamboo.build.working.directory}\target\ \\DEVARCHER\inetpub\wwwroot\phoenix\ /MIR) ^& IF %ERRORLEVEL% LEQ 4 exit /B 0
所属していません StackOverflow