-
Notifications
You must be signed in to change notification settings - Fork 24
Hotfix Git Workflow
Branching model for Hotfix based off: http://nvie.com/posts/a-successful-git-branching-model/
Make sure to make hotfix changes are in a separate branch so they can be merged back into develop and master separately.
-
Pull latest into master:
git checkout master
, thengit pull origin master
-
Branch from master, not from develop:
git checkout -b release-x.y.z master
-
Make changes and test
Merge your changes back into master and prepare to deploy them out to the servers.
-
git fetch
-
git checkout master
-
git pull origin master
-
git merge release-x.y.z master
-
git tag -a vx.y.z -m 'Hotfix for release vx.y.z'
You can find the version numbers: https://github.com/psu-stewardship/scholarsphere/releases -
git push origin master
-
git push --tags
Test the deployment to staging. Have you changed the Data model? Yes? Go to Step 1. No? Go to Step 2.
-
cap staging deploy BRANCH_NAME=master
-
Do a rolling deploy when you are ready
Command must be run in sequence. Do not run them at the same time
cap staging deploy BRANCH_NAME=master --hosts ssjobs1staging.dlt.psu.edu
cap staging deploy BRANCH_NAME=master --hosts ss1staging.dlt.psu.edu
cap staging deploy BRANCH_NAME=master --hosts ss2staging.dlt.psu.edu
Have you changed the Data model? Yes? Go to Step 1. No? Go to Step 2.
- Deploy during the maintenance window
cap production deploy BRANCH_NAME=master
- Do a rolling deploy when you are ready
Command must be run in sequence. Do not run them at the same time
cap production deploy BRANCH_NAME=master --hosts ssjobs1prod.dlt.psu.edu
cap production deploy BRANCH_NAME=master --hosts ss1prod.dlt.psu.edu
cap production deploy BRANCH_NAME=master --hosts ss2prod.dlt.psu.edu
Include the new released version in the develop branch.
-
git fetch
-
git checkout develop
-
git pull origin develop
-
git merge release-x.y.z develop
Now the hotfix branch can be deleted
-
git branch -d release-x.y.z
-
git push origin :release-x.y.z