Deployment
Core GIT
Core environments
prod- Production environmentdev- Testing environment
Core git branches
prod- The latest stable version deployed toprod(production)dev- Ready to test version deployed todev(staging)main- Master branch with the most up-to-date stable version (For archiving / backup purposes only)
General git Flows
Use feature/xxx or bug/xxx
First Steps
To start working on new feature/bug
- Assign JIRA Ticket and set to “In Development"
- Create new
feature/xxxbranch from release - Work in the
feature/xxxbranch on all development, fixes or updates - Regularly merge
prodintofeature/xxxto keep it up to date, commands:git checkout feature/xxxgit fetch origingit merge --no-ff origin/prod
Deploy feature for testing
When the feature is ready for testing, merge it into dev branch.
Merge
prodinto thefeature/xxx- to keep feature updated.Merge
feature/xxxinto thedevDeploy
devbranch todevenvironment.Navigate to front admin and/or front web where “deploy.sh” file is:
cd <project_directory>/front-webDeploy:
Front End:
./deploy.sh devBack End (web-api):
./deploy.sh app-name stage-name
For example:./deploy.sh feeds-infrastructure dev
Set the JIRA Ticket to "Ready for QA"
Release feature
If QA succeeds, merge the feature/xxx branch into the prod branch.
Merge
prodinto thefeature/xxx- to keep feature updated.Merge
feature/xxxinto theprodDeploy
prodbranch toprodenvironment.Navigate to front admin and/or front web where “deploy.sh” file is:
cd <project_directory>/front-webDeploy:
Front End:
./deploy.sh prodBack End (web-api):
./deploy.sh app-name stage-name
For example:./deploy.sh feeds-infrastructure prod
Set JIRA Ticket to "Done"
Backup / Restore
Create Backup
The main branch is used for backup.
It is recommended to regularly merge the stable prod branch to main.
git checkout main && git merge prod
Restore Backup
If prod suddenly fails, you can always rollback to main:
git checkout main
Redeploy Front End:
./deploy.sh prod
Redeploy Back End:
./deploy.sh app-name stage-name
For example:
./deploy.sh feeds-infrastructure prod