【发布时间】:2019-07-17 10:31:32
【问题描述】:
我有一个带有 CentOS 代理的 Azure 管道。管道不会在构建失败时中断。这是管道 yaml 配置的一部分:
- bash: |
dotnet --version
dotnet build $(Build.Repository.LocalPath)/ProjA -c Release -r linux-x64
dotnet build $(Build.Repository.LocalPath)/ProjB -c Release -r linux-x64
failOnStderr: true
displayName: build
env:
DOTNET_CLI_HOME: /tmp
如何让它在构建错误时失败?
构建日志:
##[section]Starting: build
==============================================================================
Task : Bash
Description : Run a Bash script on macOS, Linux, or Windows
Version : 3.151.2
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/bash
==============================================================================
Generating script.
========================== Starting Command Output ===========================
[command]/usr/bin/bash --noprofile --norc (path)be642b86-51b1-44c5-8727-71cc18ec0678.sh
2.2.300
Microsoft (R) Build Engine version 16.1.76+g14b0a930a7 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 2.22 sec for (ProjA)
...
Build FAILED.
...
7 Warning(s)
3 Error(s)
Time Elapsed 00:00:05.73
Microsoft (R) Build Engine version 16.1.76+g14b0a930a7 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 568.52 ms for (ProjB)
...
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:03.17
##[section]Finishing: build
【问题讨论】:
-
它应该构建失败。您的详细构建日志是什么?
-
你能分享一个示例项目吗?
-
@starianchen-MSFT,感谢你们的 cmets。很遗憾我不能提供这个项目。
-
您可以分享一个可以减少此问题的简单示例项目。
标签: bash azure asp.net-core .net-core azure-devops