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