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

Multiple artifacts in cloudbuild.yaml

How can I do something like this in my cloudbuild.yaml:

artifacts:
  objects:
    location: 'gs://<my_dir>/'
    paths: ['dist/index.html']

artifacts:
  objects:
    location: 'gs://<my_dir>/<my_subdir>/'
    paths: ['dist/assets/*']

So that different files generated during the build go to different folders in the same bucket?

0 1 306
1 REPLY 1

Hello @JonGCP,

Welcome to the Google Cloud Community!

Take a look at this documentation: Storing artifacts in Cloud Storage.

Do note that:

  • You can only specify one bucket to upload the artifacts and you must be the owner of the bucket
  • You can upload any number of artifacts, but you can specify only up to one hundred artifact paths
  • If you upload an artifact in a bucket with the same name, the new artifact will replace the existing artifact.

Take a look at this example YAML file:

artifacts:
  objects
:
    location
: [STORAGE_LOCATION]
    paths
: [[ARTIFACT_PATH],[ARTIFACT_PATH], ...]

If the above option doesn't work, you can contact Google Cloud Support to further look into your case. Let me know if it helped, thanks!

Top Solution Authors