当angular-cli报告错误时,失败TeamCity构建

问题描述 投票:0回答:1

我正在尝试配置团队城市来运行angular 5应用程序构建。我有这个脚本的powershell步骤(它在构建步骤定义中而不是单独的文件)。 npm run build运行ng build

npm install
npm run build

出于某种原因,即使ng build失败,团队城市建设也不会失败。来自npm run的状态代码不会传播回PowerShell。

见下面的屏幕:enter image description here

npm teamcity angular-cli
1个回答
2
投票

如果获得状态代码,TeamCity将失败构建!= 0或获得stderr时。

您应该添加失败条件以验证日志是否有错误。

  1. 编辑配置设置 - >失败条件 - >添加失败条件
  2. 在构建日志中选择特定文本的失败构建
  3. Secelt选项包含和确切的文本。设置“npm ERR”
  4. 在**失败消息**写“在构建日志中发现错误”
  5. 保存

enter image description here

如果构建日志包含此文本,那么您的构建将失败。

此外,检查构建运行程序记录的错误消息

© www.soinside.com 2019 - 2024. All rights reserved.