Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google cloud platform CloudBuild触发器:未能将生成配置CloudBuild.yaml:json:无法将字符串解组为[]json.RawMessage类型的Go值_Google Cloud Platform_Google Cloud Build - Fatal编程技术网

Google cloud platform CloudBuild触发器:未能将生成配置CloudBuild.yaml:json:无法将字符串解组为[]json.RawMessage类型的Go值

Google cloud platform CloudBuild触发器:未能将生成配置CloudBuild.yaml:json:无法将字符串解组为[]json.RawMessage类型的Go值,google-cloud-platform,google-cloud-build,Google Cloud Platform,Google Cloud Build,当我将我的cloudbuild.yaml与cloudbuild触发器一起使用时,它会在以下情况下失败: failed unmarshalling build config cloudbuild.yaml: json: cannot unmarshal string into Go value of type []json.RawMessage 我已经将cloudbuild.yaml减少到 steps: - name: "gcr.io/skynet-2359/sonar-scanner"

当我将我的
cloudbuild.yaml
与cloudbuild触发器一起使用时,它会在以下情况下失败:

failed unmarshalling build config cloudbuild.yaml: json: cannot unmarshal string into Go value of type []json.RawMessage
我已经将cloudbuild.yaml减少到

steps:
  - name: "gcr.io/skynet-2359/sonar-scanner"
    waitFor: "-"
    args: [
      "-Dsonar.projectKey=xxx",
      "-Dsonar.sources=./src",
      "-Dsonar.host.url=http://sonarqube....",
      "-Dsonar.login=${_SONAR_TOKEN}"
    ]

substitutions:
  _SONAR_TOKEN: "..."
如果我使用CLI方式启动,则构建工作正常:

gcloud builds submit --config cloudbuild.yaml .

发现了问题
waitFor
应该是一个数组:

steps:
  - name: "gcr.io/skynet-2359/sonar-scanner"
    waitFor: ["-"]
    args: [
      "-Dsonar.projectKey=xxx",
      "-Dsonar.sources=./src",
      "-Dsonar.host.url=http://sonarqube....",
      "-Dsonar.login=${_SONAR_TOKEN}"
    ]

substitutions:
  _SONAR_TOKEN: "..."

你检查过这根线了吗?似乎正在讨论一个类似的问题,它没有解释为什么它在本地成功,但可能值得检查您的声纳令牌大小:@ParthMehta发现了这个问题。我的是因为我没有使用数组作为waitFor