简体   繁体   中英

gcloud beta builds triggers run - why specify branch name

gcloud beta builds triggers run <trigger_id> --branch=dev

Why do I need to specify branch name? My cloud build trigger with <trigger_id> already knows which branch to read from for source_to_build and which branch has the git_gile_source

Docs say I have to specify branch or sha or tag in this command. Is branch needed?

When we create a trigger from a repository, we have to specify the REGEX_PATTERN :

gcloud beta builds triggers create cloud-source-repositories 
--name="my-trigger" 
--service-account="projects/my-project/serviceAccounts/my-byosa@my-project.iam.gserviceaccount.com" 
--repo="my-repo" 
--branch-pattern=".*" 
--build-config="cloudbuild.yaml"

This REGEX_PATTERN can include multiple branches.

I am not sure but I think the branch param is required in the builds triggers run command to give the possibilty to rerun the trigger in other branches if needed.

In my opinion it is better with this behaviour and it gives more flexibility.

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