Reputation: 88317
When I use my cloudbuild.yaml
with CloudBuild trigger, it fails with:
failed unmarshalling build config cloudbuild.yaml: json: cannot unmarshal string into Go value of type []json.RawMessage
I already reduced my cloudbuild.yaml to
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: "..."
The build works if I use the CLI way to start:
gcloud builds submit --config cloudbuild.yaml .
Upvotes: 4
Views: 5581
Reputation: 88317
Found the issue. waitFor
should be an array:
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: "..."
Upvotes: 3