I have hudson setup on a CI server, I'm using robocopy to copy files across to a webserver.
I'm having some problems with exit codes. Robocopy reports so many different exit codes for success and failure, hudson doesn't understand them and reports anything other than 0 as a failure.
I though I'd managed to get around this by calling robocopy to do the same job twice. So the first time it does the task and returns a non-zero exit code and the next time it has nothing to copy so returns a 0. This works when I click the build button on Hudson, but not when it's monitoring the git repo for some reason.
So my question is, can I tell hudson about the individual exit codes so that the build succeeds or would I have to create a wrapper around robocopy to provide exit codes that hudson understands?
UPDATE After Peter's answer, I added the following statements at the end of my robocopy script
if ERRORLEVEL 1 set ERRORLEVEL=0 if ERRORLEVEL 2 set ERRORLEVEL=0 if ERRORLEVEL 3 set ERRORLEVEL=0 if ERRORLEVEL 5 set ERRORLEVEL=0 if ERRORLEVEL 6 set ERRORLEVEL=0 if ERRORLEVEL 7 set ERRORLEVEL=0
As anything below an 8 is considered a success for robocopy, this translates the error codes for hudson and reports a success. I'd imagine I could refactor this at some point.
Thank you for your help Peter!
Re-factored this with Peter's suggestion:
if %ERRORLEVEL% LEQ 7 set ERRORLEVEL=0