简体   繁体   中英

How to make Cloud build Trigger to trigger only on push command?

I'm using REST API to create triggers in Cloud build.

Issue 1) I created a trigger for branch push, as soon as it got created, it triggers for all the branch and started building. (more than 300 branch all started once).

2) As soon as I created a new branch it automatically got triggered.

3) If I want to specifies only 2-3 branches. how to do it?

can anyone suggest me the solution for all the above issues?

Thanks in advance!

I think that issues 1 & 3 are solved by adding the correct branch whenever you are doing a post to create a new trigger. You can specify a list of branches to match in order for them to trigger your build, and you can use regex to match only some branches, not all of them.

In order to create the trigger, you can follow the official documentation on how to create it using the REST API. All the information regarding triggers and its usage through the REST API can be found in this link .

As for your issue number 2, Cloud Build will trigger as soon as the associated branch it's created as it counts as a push. This is easily avoidable if your regex rules that apply to certain trigger do not match your newly created branch or either you specify a trigger for your new branch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM