Reputation: 6779
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?
Upvotes: 0
Views: 565
Reputation: 6572
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/[email protected]"
--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.
Upvotes: 1