5
votes

I have build triggers set up in the Google Cloud Container Builder that are set to trigger on specific branches and use the cloudbuild.yml config in the repo. For about the first day that I pushed commits to any of these branches, it triggered a container build and completed successfully. Since then, the triggers have only worked intermittently.

Sometimes Google Cloud Container Builder doesn't detect the commit at all (I have checked the commit is in bitbucket and the commit is on the right branch). At that point, I've tried manually triggering a build through the google console, but it uses the older commit that it last built on, not the latest commit. So then I will try to push small changes from the repo or do an empty commit.

Sometimes that triggers the build, sometimes not. The interesting thing is that when the build finally triggers on a branch after a while, it will trigger builds on the other branches if they have a recent commit that hasn't been built.

I have no idea how to resolve this. Has anyone experienced a similar problem?

UPDATE:

I solved my problem. I originally added each bitbucket repository to the Source Repositories in Google Cloud. After that, I added the build triggers for each of those repos in the Container Registry. When adding the trigger, I had to go through the same process of connecting to the repositories in Bitbucket as I was taken through with adding the source repositories. I later realized that it had created a separate connection in the Source Repositories section for each of these repos automatically. So I had two connections to each repo in bitbucket listed in the Source Repositories. Once I deleted the duplicates, the triggers started working consistently.

In summary, make sure you don't have any duplicate connections in the Source Repository.

1
I have the same type of issue. Build is triggered but using a previous commit. The problem seem to happen only with github, not with bitbucket. One thing you could try is re-create the trigger. - znat
Same issue here... Did you find a workaround? We tried setting up a new git repo, but to no avail. - Henrik
same issue. Triggering the trigger manually doesn't even work and will pull the old branch that's already been build - Jakob Harder Holmelund
any solutions? I'm faced with the exact same issue. - mbutan
Any one found the solution for this? - Uysim Ty

1 Answers

0
votes

There were created a separate connection in the Source Repositories section for each of these repos automatically. So there were two connections to each repo in bitbucket listed in the Source Repositories. Once deleted the duplicates, the triggers started working consistently.

In summary, make sure you don't have any duplicate connections in the Source Repository.