大家好!
在Jenkins中,当我尝试构建我的作业时,我在配置->构建我的作业的robocopy /mir pathSource pathDest
之前运行批处理命令。但是当他执行命令时,没有运行build.xml就停止了。因此,在命令批处理结束前,他打印了以下内容:
16:47:25 Ended : Mon Nov 07 16:47:25 2016
16:47:25
16:47:25 c:jenkins_slaveworkspace********>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有不同的返回码和错误级别,表示拷贝的状态。简而言之,你可以退出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
祝你好运!