构建步骤 'Execute Windows batch command' 将构建标记为失败。请问我该如何解决这个问题?

Build step 'Execute Windows batch command' marked build as failure. How can I fix this please?

大家好!

在 Jenkins 中,当我尝试构建我的作业时,我 运行 在 robocopy /mir pathSource pathDest 之前在 tn Configue->Build 我的作业中执行了一个批处理命令。但是当他执行命令时,他没有运行 build.xml就停止了。所以他在停止之前的命令批处理之后打印了这个:

16:47:25    Ended : Mon Nov 07 16:47:25 2016
16:47:25 
16:47:25 c:\jenkins_slave\workspace\********>exit 1 
16:47:25 Build step 'Execute Windows batch command' marked build as failure
16:47:26 Sending e-mail to: *********** (launcher, owner).
16:47:26 Notifying upstream projects of job completion
16:47:26 Finished: FAILURE

请问我该如何解决这个问题?

Robocopy 有不同的 return 代码和错误级别,指示副本的状态。短版本 - 你可以退出 0。 长版 - 运行 以下内容:

Robocopy SOURCE DEST /e /np /R:5 /mt:64 /XD IGNORE

if errorlevel 16 echo ***FATAL ERROR*** & goto endError
if errorlevel 15 echo FAIL MISM XTRA COPY & goto endError
if errorlevel 14 echo FAIL MISM XTRA & goto endError
if errorlevel 13 echo FAIL MISM COPY & goto endError
if errorlevel 12 echo FAIL MISM & goto endError
if errorlevel 11 echo FAIL XTRA COPY & goto endError
if errorlevel 10 echo FAIL XTRA & goto endError
if errorlevel 9 echo FAIL COPY & goto endError
if errorlevel 8 echo FAIL & goto endError
if errorlevel 7 echo MISM XTRA COPY & goto endError
if errorlevel 6 echo MISM XTRA & goto endError
if errorlevel 5 echo MISM COPY & goto endError
if errorlevel 4 echo MISM & goto endError
if errorlevel 3 echo XTRA COPY & goto endSuccess
if errorlevel 2 echo XTRA & goto endSuccess
if errorlevel 1 echo COPY & goto endSuccess
if errorlevel 0 echo –no change– & goto endSuccess

:endSuccess
exit 0
:endError
exit 1

祝你好运!