Skip to content
This repository has been archived by the owner on Nov 18, 2020. It is now read-only.

Release git workflow

Adam Wead edited this page Aug 18, 2020 · 19 revisions

At Least 1 day before deployment

Create the Release Branch

Depending on the release type, you'll create a release branch accordingly:

Standard Releases

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.

Hotfix Releases

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 to stage and Test!

Deploy the release the stage server and test using the Testing Scripts.

cap stage_new deploy BRANCH_NAME=<release-branch>

Merge Release Branch into Master, and Tag

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

On the day of deployment during the maintenance window

Deploy to production:

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.

Later on the day of deployment

Capistrano Deploy Notes

Merge Release branch back into Development

  1. checkout develop branch git checkout develop

  2. Update develop code from repo git pull origin develop

  3. Merge release branch git merge <release-branch> --no-ff

  4. Run tests rspec

  5. Push changes up to develop git push origin develop

Clean up

  1. Delete local and remote release branches
  2. 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.
Clone this wiki locally