我们有一个Scala项目,我们使用SBT作为其构建工具。 我们的CI工具是TeamCity的,我们使用命令行自定义脚本选项与以下命令来构建项目:TeamCity的自定义脚本中的exitCode不正确
call %system.SBT_HOME%\bin\sbt clean package
构建过程工作正常时,生成成功,但是,当编译失败 - 的TeamCity认为,该脚本退出exitCode 0而不是1预期,这导致TeamCity构建成功,虽然编译失败。
当我们运行在本地CMD我们看到,错误级别为1
构建日志的相关部分相同的命令:
[11:33:44][Step 1/3] [error] trait ConfigurationDomain JsonSupport extends CommonFormats {
[11:33:44][Step 1/3] [error] ^
[11:33:44][Step 1/3] [error] one error found
[11:33:45][Step 1/3] [error] (compile:compile) Compilation failed
[11:33:45][Step 1/3] [error] Total time: 12 s, completed Jan 9, 2014 11:33:45 AM
[11:33:45][Step 1/3] Process exited with code 0
怎么才能让TeamCity的认识的失败建立?
如何检查cmd上的errorLevel? –
回声%errorLevel% – Yosefki
您可以使用相同的答案用于这个其他帖子:http://stackoverflow.com/a/23338173/684582 –