Skip to content

How do we deploy this thing?

DeeDeeG edited this page Mar 10, 2021 · 9 revisions

Deployment

This repo is set to automatically deploy to Heroku. Any time there is a merge into develop, the develop branch will be deployed to staging.refugerestrooms.org. Any time there is a merge into master, the master branch will be released to refugerestrooms.org

When making a release, you should do the following:

New way (squash and merge a release branch into master)

  1. Check the latest releases on github.

  2. Create a new branch release-x.y.z (replace "x.y.z" with the actual version) based on develop.

    How to do this on GitHub.com (click to expand).

    Branch switcher button being used to create a new branch

    Click the branch switcher button on the RefugeRestrooms repo's main page here on GitHub.com, then type "release-x.y.x" with the "x.y.z" replaced by whatever version you are actually planning to release. Then click "Create branch: release-x.y.z from 'develop'", or hit the "Enter"/"Return" key.

  3. Create (start editing) a new pull request from the release-x.y.z branch against master branch.

  4. Label the Pull Request "Release" and Title it "Release x.y.z" where 'x.y.z' is incremented from the most recent release.

  5. Pull develop branch locally; run git shortlog [previous-release-tag-here]..HEAD

    • Changelogs can get a little weird depending on which branches merged into which other branches... Please look over this info and make sure it matches what really changed. If not, it's good to look up what actually changed and edit this changelog until it actually matches what happened since the last release.
  6. Copy the result of step 5 into the body of the pull request.

  7. Open the Pull Request.

  8. If the PR "cannot be merged automatically" into master (meaning there are merge conflicts), merge master branch into this PR's release-x.y.z branch with the "Update branch" button at the bottom of the Pull Request page.

    • (You may need to resolve merge conflicts manually on the command-line, or using some more-advanced tool than GitHub.com, if the button is grayed out/not working. More-advanced or more-complicated merge conflicts cause this.)
  9. Double-check that the site still is still working as intended on Heroku Staging (https://staging.refugerestrooms.org).

  • (Optionally, to test that merging from master worked okay, push the PR branch to your own personal Heroku account for testing.)
  1. Once verified, merge the pull request with the "Squash and merge" option.
    • master branch automatically deploys to Heroku. The update should be live soon at https://refugerestrooms.org.
    • There will be many unrelated commit showing as part of this PR, due to how we handle the develop and master branches at the moment. Please delete all of these from the commit message GitHub suggests, and only include commits that are actually new since the last release in the commit message.
  2. Go back to github releases and create a new release from develop, with the new version number. Copy the body of the pull request into the Release Notes.
  3. Save the release.

Old way (merge commit from develop into master)

  1. Check the latest releases on github.
  2. Open a new pull request from develop against master.
  3. Label the Pull Request "Release" and Title it "Release x.x.x" where 'x.x.x' is incremented from the most recent release.
  4. Pull both develop and master locally; run git shortlog --grep "Merge pull request #" %{previous release}..HEAD
  5. Copy the result of 4, into the body of the pull request.
  6. Open the Pull Request.
  7. Once CI has passed, deploy to Heroku Staging.
  8. Once verified, merge the pull request and deploy master to Heroku.
  9. Go back to github releases and create a new release from master, with the new version number. Copy the body of the pull request into the Release Notes.
  10. Save the release.

Note: @mi-wood and @tkwidmer both have heroku privileges, and can do the deploys for you. You can hit us up on slack.