gpt4 book ai didi

google-cloud-platform - CloudBuild 触发器 : failed unmarshalling build config cloudbuild. yaml : json: cannot unmarshal string into Go value of type []json. RawMessage

转载 作者:行者123 更新时间:2023-12-04 14:16:58 24 4
gpt4 key购买 nike

当我将 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: "..."

关于google-cloud-platform - CloudBuild 触发器 : failed unmarshalling build config cloudbuild. yaml : json: cannot unmarshal string into Go value of type []json. RawMessage,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59233661/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com