简体   繁体   English

如何打印出管道或阶段的参数?

[英]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.

相关问题 使用 jenkins 管道进行部署时,如何将参数从第一个 cdk 堆栈的 output 传递到另一个 cdk 堆栈的输入? - How do i pass parameters from first cdk stack's output to another cdk stack's input, when deploying using jenkins pipeline? 我如何创建 amazon s3 url 以允许我的部署目标使用 SSM runCommand 下载由构建阶段创建的文件 - How do I create the amazon s3 url in a way that allows my deployment target to download a file created by the build stage using SSM runCommmand 我可以在某个条件下运行 gitlab 管道阶段吗? - Can I run gitlab pipeline stage on a condition? 直接在 AWS Sagemaker Pipeline 中访问参数的值 - Access Parameter's value directly in AWS Sagemaker Pipeline 我如何找到昨天的日期 - How do I find yesterday's date 如何在 azure 流水线的不同阶段找到工作 - How to get a job on a different stage in azure pipeline 如何在数据融合的批处理管道中将参数传递给宏 - How can I pass parameter to Macro in batch Pipeline of Data Fusion 尝试将文件上传到 firebase 存储但它不起作用。 error object 是空的,我怎么弄清楚哪里出了问题? - Trying to upload files to firebase storage but its not working. Error object is empty, how do I figure out what's wrong? 如何从 Firestore 获取文档 ID 列表 - How do I get a list of document ID’s from Firestore 如何将用户的 Firestore Map 读取为 Swift 字典? - How do I read a User's Firestore Map to a Swift Dictionary?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM