GitOps
Constraints
Branches
Main branches
Master for production
Develop for next release
master branch always represent stable, production ready code. last commit on master is always the tag commit.
We use develop branch for automatic building jars and docker images then publish to nexus and GCR via Continuous Integration(CI) process. We use master branch for automatic deployment to integration GKE cluster/namespace via Continuous Deployment(CD) process.
Supporting branches
Release naming
release/#.#.#Feature naming
feature/*Hotfix naming
hotfix/*
Supporting branches are temporary. after merging, they get deleted.
Restrictions
Restrict commits directly to master branch except merges by Release Manager role
Restrict commits directly to develop branch, and allow only PR mergers.
Do's and Don'ts
Don't push code directly to
masterbranchDon't push tags directly to
masterbranchDon't push code directly to
developbranchDo make a
feature/*branch fromdevelopbranchDo merge
feature/*branch todevelopbranch via PR process.Release: When
developbranch is stable, createreleasebranch i.e.,release/0.1.0Do create CHANGELOG.md and commit on
releasebranchDo merge code commits from
releasebranch todevelopandmasterbranchWe shouldn't merge any features directly to the release branch
We should only add bug fixes and release note, changelog to release branch.
Hotfix: If you need to patch a release,
Do make a
hotfix/*branch frommasterbased on specific tag or head of themasterbranchDo merge code commits from
hotfix/*branch to bothdevelopandmasterbranches via PR process.
Push feature branches back to origin repo so others can collaborate
Use the GitHub/BitBucket website to create pull requests from feature branches
Don’t accept your own pull requests!
CI/CD Automation
Following actions are triggered on CI (jenkins, github actions)
When code commits pushed to
feature/*branchAutomatic code review: CI run code quality checks(run unit tests, linting, code coverage, code quality checks with sonar )
CI continuously check code quality with each push and update build status on
BitBucketorGitHibPRWhen CI checks pass, Developer crete PR to merge
feature/*branch todevelopbranchApprovers do code review and merge the PR. Finally delete
feature/*branch
When PRs merged from
feature/*branch todevelopbranchCI run build step (build jars, build docker images with next SNAPSHOT version)
Here the computed version looks like
0.2.1-SNAPSHOTCI run publish step (publish jars to Nexus, publish docker images to GCR)
CI run deploy step (deploy new images to integration GKE cluster via helm i.e.,
helm upgrade bigfoot/core --version=$VERSION -f config.yaml)CI run e2e test step (run ??? ), targeting qa GKE cluster/namespace
When code commits pushed to
release/*branchAbove
feature/*steps will also apply torelease/*andhotfix/*branchesIn addition, we can also automatically generate Changelog and Release notes.
When
release/*branch merged tomasterbranch and taggedCI run build step (build jars, build docker images with stable version from Latest/Highest git tag on
masterbranch)Here the computed version looks like:
0.2.0CI run publish step (publish jars to Nexus, publish docker images to GCR)
CI run deploy step (deploy new images to integration GKE cluster via helm i.e.,
helm upgrade bigfoot/core --version=$VERSION -f config.yaml)CI run e2e test step (run ??? ), targeting integration GKE cluster/namespace
Last updated
Was this helpful?