首页 > 解决方案 > bash使用带有jq的变量在文件json中添加属性

问题描述

这是代码:

pipeline {
  agent any
  stages {
    stage('parse') {
       steps {
          script{
              sh "jq -n ${params.name} ${params.version} >fichier.json"
           }
        }
     }     
  }
}

这是输出错误:

jq: 

error: test/0 is not defined at <top-level>, line 1:
test
jq: 1 compile error

ps:test是params name的返回

标签: jsonshelljenkinsjenkins-pipeline

解决方案


推荐阅读