3

We are using cloud build but unlike circle CI, we have not found a way to make sure if trigger is called twice to make sure one build is run AFTER the other so they are not all run at the same time. Is there a way to do this in google cloud build?

I don't see this config in cloudbuild.yaml or in the GUI...

https://cloud.google.com/cloud-build/docs/build-config

Dean Hiller
  • 19,235
  • 25
  • 129
  • 212

1 Answers1

3

Official documentation: Each Google Cloud project is granted quota to run ten builds at a time. When this quota is filled, requests for additional builds are queued and processed serially after the running build completes. An infinite number of builds can be queued.

Simply decrease the quota to 1 and the builds will be executed one at a time, while the other builds will wait in the queue.

https://console.cloud.google.com/iam-admin/quotas

enter image description here

This is a fast workaround. Here is an answer with some references on custom builders usage. You may need to create your own queuing logic if you have for example 3 different builds and you don't want them to block each other, while each one of them has no more than one ongoing instance.

Neo Anderson
  • 5,957
  • 2
  • 12
  • 29