Skip to content

Instantly share code, notes, and snippets.

View juanmatias's full-sized avatar

Juan Matías Kungfoo de la Cámara Beovide juanmatias

View GitHub Profile
@juanmatias
juanmatias / pre-commit.yaml
Created October 8, 2020 19:48
uglymedium-tables-gitflowgithubcloudbuild
- 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_\.\-]+']
@juanmatias
juanmatias / pre-commit.sh
Created October 5, 2020 19:24
uglymedium-tables-gitflowgithubcloudbuild
#!/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 ]]
@juanmatias
juanmatias / table002.md
Created October 5, 2020 19:20
uglymedium-tables-gitflowgithubcloudbuild
BranchRegex4triggerYaml nameTrigger action
master push^master$cloudbuild-master.yamlpush
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.yamltag
develop^develop$cloudbuild-develop.yamlpush
feature/fix branch^(feature/|fix/).+$cloudbuild-feature.yamlpush
release/hotfix branch^(release/|hotfix/).+$cloudbuild-release.yamlpush
PR^(master|develop)$cloudbuild-pr.yamlcomment
@juanmatias
juanmatias / table001.md
Last active October 5, 2020 19:21
uglymedium-tables-gitflowgithubcloudbuild
cloudbuild-master.yaml It’s triggered
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.
@juanmatias
juanmatias / table001.sv
Created October 5, 2020 18:27
uglymedium-tables-gitflowgithubcloudbuild
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

Keybase proof

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: