We have something like this set up at the moment; 2 repos (aws and github):
master(aws)next(aws)integation(aws)master(gh)next(gh)integration(gh)
(for simplicity, loosely based upon https://nvie.com/posts/a-successful-git-branching-model/)
Remove the AWS repo, use Github repo as it provides a good developer experience for collaboration, without the need for developers to have AWS accounts.
master(gh)next(gh)develop(gh)
Make the pipeline react to Github pushes/pull request merges instead.
- production site tracks
master - beta site tracks
next
- define rigid structure and processes around how devs interact with core branches (
develop,next,master) - any code submitted via pull request is considered accepted and deployable (it's been code reviewed, after all)
- beta site allows us to find edge cases, bugs with the code that we can address within
next, leavingdevelopfree for next work by other devs - make branch management & code reviews easier, reduce merge conflicts - overall, improve developer efficiency
- less hands on manual merging between branches (and remotes!)
develop:
- it is a 'collection point' of code-reviewed, dev-tested 'working' changes that are suitable for promoting to the beta server (via the
nextbranch) - receives commits from
nextvia merge (in the case of downstream fixes on eithermasterornext) - 99% of dev branches are created from this as a base branch
- it will be necessary for devs to regularly rebase outstanding fix/feature branches to ensure they are locally testing all other
developchanges - those same 99% of created branches are merged into this branch via Github pull requests
- merging a pull request means:
- that the dev tested affected parts of the site
- the changes have been code reviewed
next:
-
- merges/commits trigger beta site update
- receives commits from
mastervia merge (in the case of a hotfix applied to master) - receives merges from
develop(based on completed trello card bug fixes/features, etc) - this can be once daily, or as needed/on-demand - create & merge fix branches to address issues found in beta site testing
master:
-
- merges/commits trigger production site update
- receives merges from
next - create & merge hotfix branches (urgent, emergency fixes)
Most developers focus on changes that merge into the develop branch. Occasionally, beta feedback will require devs to work on changes targeting next, which will need to be merged back into develop. Very rarely, a senior dev may need to hotfix directly against master, which will need to be merged back into both next and develop