-
Notifications
You must be signed in to change notification settings - Fork 24
Release git workflow
Depending on the release type, you'll create a release branch accordingly:
These originate from the develop branch and usually reflect the typical workflow of a scheduled release.
Once all commits have been pushed to develop, and Travis is green, create the release branch from develop:
git checkout develop
git pull origin develop
git checkout -b release-<version #>
git push origin -u release-<version #>
bundle exec rspec
At this point, any additional commits for this release should be made to the release branch and not develop.
These originate from master, and are generally used if there are commits requiring immediate deployment outside of the regular development process.
First, create a hotfix branch off of master:
git checkout master
git pull origin master
git checkout -b hotfix-<version #> master
git push origin -u hotfix-<version #>
Make the necessary changes for the release on the hotfix branch, and not develop.
Deploy the release the stage server and test using the Testing Scripts.
cap stage_new deploy BRANCH_NAME=<release-branch>
Assuming you don't have the master branch locally, you'll need to get that branch from the repository, which we assume is 'origin' if that is not the case then substitute 'origin' with the name of your repository. If you aren't sure of your repository name you can run git remote -v
inside a git repo to see the names of your remote repositories.
Note: You should not fast-forward --no-ff
when merging release branches because it always ensures there is a record of the merge in the commit history.
git checkout master
git pull origin master
git merge <release-branch> --no-ff
rspec
git tag -a -m "Tagging release <version #>" v<version #>
git push origin master
git push origin --tags
bundle exec cap prod deploy BRANCH_NAME=master
Run through the sanity checks to ensure everything is working properly. If anything doesn't work, execute a roll back via Capistrano. Notes TDB.
-
checkout develop branch
git checkout develop
-
Update develop code from repo
git pull origin develop
-
Merge release branch
git merge <release-branch> --no-ff
-
Run tests
rspec
-
Push changes up to develop
git push origin develop
- Delete local and remote release branches
- Don't forget to make sure qa is running the branch you want it to be running, it may be running out of master or the release branch because of the schedule.