Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图通过詹金斯工作安装插件。重启的时候退出码是1641,但是安装成功了。所以我想让构建成功。我正在使用“setup.exe /qb /log C:\installer.log /r:f”这个命令进行静默安装和强制重启。
如何标记构建成功
Jenkins 将退出最后一个命令的结果。你只需要抓住它并告诉詹金斯如何退出。
Linux - RESULT=$? Windows -set RESULT=%ERRORLEVEL%
RESULT=$?
set RESULT=%ERRORLEVEL%
捕获命令的结果后,您可以if在其上放置一个来决定如何退出。
if
Linux - if [ $RESULT -eq 1641 ]; then exit 0; fi Windows -if %RESULT% EQ 1641 exit 0
if [ $RESULT -eq 1641 ]; then exit 0; fi
if %RESULT% EQ 1641 exit 0
我希望这有帮助。