【问题标题】:How to document the runtime values of Build Variables in Azure DevOps build pipeline如何在 Azure DevOps 构建管道中记录构建变量的运行时值
【发布时间】:2020-06-17 16:44:26
【问题描述】:

在 TeamCity 中,很容易看到构建使用(或更准确地说:可用)的所有参数的运行时值,以及构建时这些参数的实际值。

Azure DevOps 构建管道也使用参数(它们称为变量)。但是我如何才能看到这些变量在构建过程中的值是什么?

例如,我的构建管道定义了一个名为 $(agent.builddirectory) 的变量。如何查看该变量解析为什么?

【问题讨论】:

标签: azure-devops azure-pipelines


【解决方案1】:

编辑您的管道并添加以下任务之一

  1. 您可以将Bash 任务(需要在代理上使用 Bash)与
Type = Inline
Script = env | sort
  1. 仅适用于 Windows 代理,您可以将 Command Line 任务与
Tool = cmd.exe
Arguments = /k set

【讨论】:

  • 旁注:设置system.debug = true 不会将变量打印到管道日志中。
猜你喜欢
  • 2022-12-15
  • 1970-01-01
  • 2021-01-21
  • 1970-01-01
  • 2023-03-09
  • 2022-11-03
  • 2020-12-04
  • 2022-11-02
  • 1970-01-01
相关资源
最近更新 更多