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.
我在 GoCD 中使用自定义命令(批处理文件)来使用 MSBuild 构建我的解决方案。现在我无法在批处理文件中设置错误,因此 GoCD 代理知道它可以停止,因为某些事情失败了。现在,当构建失败时,作业仍然成功。
如何解决 GoCD 捕获的错误?
您必须使用退出代码 != 0 退出批处理脚本,例如使用EXIT /B 1.
EXIT /B 1
go 代理将除零以外的任何退出代码解释为错误,并且在默认配置中,错误会阻止后续任务和阶段运行。