[英]How do I print out a pipeline's or a stage's parameter?
Let's say I have the following stage and pipeline:假设我有以下阶段和管道:
stages:
- stage: A
lockBehavior: sequential
jobs:
- job: Job
steps:
- script: Hey!
lockBehavior: runLatest
stages:
- stage: A
jobs:
- job: Job
steps:
- script: Hey!
How would I print out the lockBehavior parameter out in Azure Devops when running the pipeline?运行管道时,如何在 Azure Devops 中打印出 lockBehavior 参数? I have tried printing out all variables using this code:
我尝试使用此代码打印出所有变量:
jobs:
- job: testing
steps:
- task: Bash@3
inputs:
targetType: 'inline'
script: 'env | sort'
But this does not work.但这不起作用。
I checked the parameters "lockBehavior" from here .我从这里检查了参数“lockBehavior”。 But I haven't found out a method to show the value in the pipeline log.
但是我还没有找到一种方法来显示管道日志中的值。 However, there is a note "If you do not specify a lockBehavior, it is assumed to be runLatest."
但是,有一个注释“如果不指定 lockBehavior,则假定为 runLatest”。 In my view,it's not hard to know the value if you set up it by yourself.
在我看来,如果你自己设置它,就不难知道它的价值。
As my experience, you can print some "Use predefined variables" or "https://learn.microsoft.com/en-us/azure/devops/pipelines/process/runtime-parameters?view=azure-devops&tabs=script" by following the offical doc根据我的经验,您可以通过按照官方文档
So i guess that perhaps this parameter will be added in the future in the "Use predefined variables".所以我想也许这个参数将来会添加到“使用预定义变量”中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.