- This is the Branching & Git Case, a project given by the Young Coders Club (Havas CX).
You are leading a team where you should build awebsite for an e-commerce company. 2 teams areworking in different parts of the code development,separated as frontend and backend. The companydecides to have all the development in onerepository. They provided 3 environments calleddev, staging and production. They would like toknow how branching strategy will work and howshould the CI/CD be set up? (i.e which branchesshould be connected to the environments)
- Create a ‘master’ branch in the repository. Thisbranch will be used to deploy the code to theproduction environment.
- Create a ‘dev’ branch in the repository. Thisbranch will be used to deploy the code to thedevelopment environment.
- Create a ‘staging’ branch in the repository. Thisbranch will be used to deploy the code to thestaging environment.
- Create a ‘feature’ branch for each feature thatyou are developing. This branch should bebranched off from the ‘dev’ branch.
- When a feature is complete, it should be mergedinto the ‘dev’ branch.
- When the code is ready for testing, it should bemerged into the ‘staging’ branch.
- When the code is ready for release, it should bemerged into the ‘master’ branch.
- Set up a Continuous Integration (CI) server tomonitor the repository.
- Set up a Continuous Delivery (CD) server todeploy the code to the different environments.
- Set up rules to deploy the code to the differentenvironments.
- Set up automated tests to ensure that the code isof high quality.
- Set up automated alerts to notify the team of anyissues.
a. The ‘master’ branch should be connected to theproduction environment.
b. The ‘staging’ branch should be connected to thestaging environment.
c. The ‘dev’ branch should be connected to thedevelopment environment.