So this turned out to be an issue with how
Google Cloud Build handles an encounter with the configuration file
cloudbuild.yaml. It has to spawn a new build every time it sees one, regardless of whether it has already been seen.
In my case, since the project was tiny, the
cloudbuild.yaml and my go source were both at the root of the project. This lead to the following situation:
- The initial
git pushtriggers a build, which reads
- The build sees that there's a
cloudbuild.yamlin the current working directory and spawns a new build for that.
I suppose this is useful as you can have multiple build configs for various things in your projects, that will be built as and when encountered.
Moving the go source to
src/ (away from the cloudbuild) fixed the issue.
tl;dr DON'T PUT YOUR
cloudbuild.yaml IN THE WORKING DIRECTORY.