- git checkout master
- git pull origin master
- git checkout staging-test
- git reset --hard origin/master // this resets the branch to have the latest changes of master
- git add [my changes]
- git commit -m "Describe my changes"
- git push -f origin staging-test
When you are done with staging: I should be within the staging-test branch here Just to be sure
- git checkout staging-test
- git reset --hard origin/master // this resets the branch to have the latest changes of master
- git status //this will show my local branch being behind the remote by 1 commit. this is because staging-test on remote would be 1 commit ahead.
- git push -f
So basically what happens when you push to staging test?
when I push to the remote branch on staging test, the ci picks up the changes and runs. it would deploy the code to the staging cluster.
Also, when I push to my branch on origin and the create a PR. After code review and the PR is merged, same thing happens. The CI picks up the code, runs test and deploys to the staging cluster as well.
In Brankas, we have a staging cluster and a production cluster. we make a release to production every 4/5 days. the latest commit from master gets merged into the production branch and this gets deployed to the production cluster.