Branch | Regex4trigger | Yaml name | Trigger action |
---|---|---|---|
master push | ^master$ | cloudbuild-master.yaml | push |
master tag * | ^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$ | cloudbuild-master-deploy.yaml | tag |
develop | ^develop$ | cloudbuild-develop.yaml | push |
feature/fix branch | ^(feature/|fix/).+$ | cloudbuild-feature.yaml | push |
release/hotfix branch | ^(release/|hotfix/).+$ | cloudbuild-release.yaml | push |
PR | ^(master|develop)$ | cloudbuild-pr.yaml | comment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- repo: https://github.com/pre-commit/pre-commit-hooks | |
rev: v2.2.1 | |
hooks: | |
- id: no-commit-to-branch | |
args: ['--pattern', '^(?!(feature|fix|hotfix|release))\/[a-zA-Z0-9_\.\-]+'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
LC_ALL=C | |
local_branch="$(git rev-parse --abbrev-ref HEAD)" | |
valid_branch_regex="^(feature|fix|release|hotfix)\/[a-z0-9._-]+$" | |
message="There is something wrong with your branch name. Branch names in this project must adhere to this contract: $valid_branch_regex. Your commit will be rejected. You should rename your branch to a valid name and try again." | |
if [[ ! $local_branch =~ $valid_branch_regex ]] |
Pipeline | Description |
---|---|
cloudbuild-feature.yaml | It’s triggered each time a push to a feature or fix branch is done.Aimed to perform tests and checks. |
cloudbuild-release.yaml | It’s triggered each time a push to a release or hotfix branch is done.Aimed to perform tests and checks. |
cloudbuild-pr.yaml | Must be triggered from a PR’s comment (‘/gcbrun’).If PR points to develop, the script will perform a merge from the branch into develop, then will delete the branch. If PR points to master, the script will perform a merge from the branch into master, then into develop, and finally will delete the branch. |
cloudbuild-develop.yaml | It’s triggered each time a push into develop branch is done. (this push must be done by the cloudbuild-pr pipeline) Aimed to perform tests, checks, and deploy the code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pipeline; Description | |
cloudbuild-feature.yaml; It’s triggered each time a push to a feature or fix branch is done.Aimed to perform tests and checks. | |
cloudbuild-release.yaml; It’s triggered each time a push to a release or hotfix branch is done.Aimed to perform tests and checks. | |
cloudbuild-pr.yaml; Must be triggered from a PR’s comment (‘/gcbrun’).If PR points to develop, the script will perform a merge from the branch into develop, then will delete the branch. If PR points to master, the script will perform a merge from the branch into master, then into develop, and finally will delete the branch. | |
cloudbuild-develop.yaml; It’s triggered each time a push into develop branch is done. (this push must be done by the cloudbuild-pr pipeline) Aimed to perform tests, checks, and deploy the code. | |
cloudbuild-master.yaml; It’s triggered each time a push into master branch is done. (this push must be done by the cloudbuild-pr pipeline) Aimed to perform tests and checks. | |
cloudbuild-master-deploy.yaml; It’s triggered |
I hereby claim:
- I am juanmatias on github.
- I am juankungfu (https://keybase.io/juankungfu) on keybase.
- I have a public key ASAl8KKxqRZVCfP1g2elFYPwscH-Iy9UjWxmWE1aZwKq6wo
To claim this, I am signing this object: