Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RoboCopy + Atlassian Bamboo Continuous Integration

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

enter image description here

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?

like image 808
amcdnl Avatar asked Apr 22 '26 08:04

amcdnl


1 Answers

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
like image 134
amcdnl Avatar answered Apr 25 '26 00:04

amcdnl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!