Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

failed unmarshalling build config cloudbuild.yaml

failed unmarshalling build config cloudbuild.yaml: yaml: line 8: did not find expected '-' indicator

I have this cloudbuild.yaml and i have similar error every time.
Does anyone see the error?

 

 

 

steps:
  - name: 'gcr.io/cloud-builders/docker'
    args: [
            'build',
            '-t',
            'gcr.io/projectID/backdevs:$COMMIT_SHA',
            '.'
          ]
  logsBucket: 'gs://artifacts.projectID.appspot.com/'
  options:
    logging: GCS_ONLY
  - name: 'gcr.io/cloud-builders/docker'
    args: ['push', 'gcr.io/projectID/backdevs:$COMMIT_SHA']
  - name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
    entrypoint: gcloud
    args:
      - 'run'
      - 'deploy'
      - 'backdevs'
      - '--image'
      - 'gcr.io/projectID/backdevs:$COMMIT_SHA'
      - '--region'
      - 'europe-west2'

images:
  - 'gcr.io/projectID/backdevs:$COMMIT_SHA'

 

 

is logsbucket mandatory?

 

 

  logsBucket: 'gs://artifacts.projectID.appspot.com/'
  options:
    logging: GCS_ONLY

 

 

 
Thanks in advance
Solved Solved
0 1 1,539
1 ACCEPTED SOLUTION

Hi @luiggibcn,

Welcome to Google Cloud Community!

Based on this documentation on building configuration file schema:

Set the logsBucket field for a build to specify a Cloud Storage bucket where logs must be written. If you don't set this field, Cloud Build will use a default bucket to store your build logs.

This means that this is an optional field and Cloud Build will just use a default bucket to store your logs.

Please check this documentation on Build configuration file schema to check if your build config file has similar structure and some values of your field may be incorrect.

Hope this helps.

View solution in original post

1 REPLY 1

Hi @luiggibcn,

Welcome to Google Cloud Community!

Based on this documentation on building configuration file schema:

Set the logsBucket field for a build to specify a Cloud Storage bucket where logs must be written. If you don't set this field, Cloud Build will use a default bucket to store your build logs.

This means that this is an optional field and Cloud Build will just use a default bucket to store your logs.

Please check this documentation on Build configuration file schema to check if your build config file has similar structure and some values of your field may be incorrect.

Hope this helps.