【问题标题】:How to use pipe operator in yml file如何在 yml 文件中使用管道运算符
【发布时间】:2019-08-06 00:08:30
【问题描述】:

我正在生成一个pipeline.yml 文件,在命令步骤中,我需要执行curl google.com | sh 之类的操作,但它似乎是按字面意思解释的。

我尝试用 shell 替换命令步骤,但似乎不受支持。我在这里错过了什么?

【问题讨论】:

    标签: continuous-integration pipe yaml buildkite


    【解决方案1】:

    管道字符在 YAML 中可以具有特殊含义。您是否尝试将命令用引号括起来以确保它是一个字符串?

    steps:
    - command: "curl google.com | sh"
    

    【讨论】:

      猜你喜欢
      • 2021-12-12
      • 1970-01-01
      • 1970-01-01
      • 2019-11-20
      • 1970-01-01
      • 1970-01-01
      • 2020-07-09
      • 2021-08-02
      • 1970-01-01
      相关资源
      最近更新 更多