Skip to content

Deploy a test branch

Jim Sifferle edited this page Mar 22, 2015 · 6 revisions

Outline

  • Identify the test branch in the Nightscout repository
  • Update the dev branch in your personal repository
  • Create a test branch in your repository (if necessary)
  • Update your test branch (if necessary)
  • Deploy your test website
  • Website setup examples

Identify the test branch

Choosing a test branch is easy. Use the list below to help you understand how the repository is organized.

  • dev - The dev branch feeds new code to future release branches and eventually to master. Dev changes frequently and not everything in dev makes it into master. Deploy dev to test new features or bug fixes before they're pushed to a release branch.
  • release/name - Release branches freeze a snapshot of the dev branch. Releases are used for final testing before pushing to master. At this stage, the focus is squashing last minute bugs. Deploy the latest release branch to assist with final testing before the code is pushed to master.
  • wip/name - The wip branches are snapshots of the dev branch. They are used to develop a new feature or bug fix independently. After initial development and testing, the code may be merged into dev for further testing. Deploy a wip branch to test a specific new feature or bug fix during its development.

Update your copy of dev

The first thing to do is update your copy of dev.

  1. Login to GitHub, then go to the Update Fork Tool
  2. Enter your username in the 'GitHub username' field and dev in the 'Branch to Update' field. Press the 'Format' button.

If your dev needs an update, you will see a blue link similar to the image below.

Fork Needs an Update Image

  1. Click the blue link and you will be taken to a GitHub screen.
  2. Press the green "Create Pull Request" button.
  3. Type a name for this update, then press the green "Create Pull Request" button.
  4. Scroll down the page of commits. In the lower right, click the "Merge Pull Request" button
  5. Click the green "Confirm Merge" button.

If your dev is up to date, you will see the message and star below.

Fork Updated Image

If you plan to test dev, then skip the next two steps and move on to "Deploy your test website"

Create the test branch

This step is required if your repository does not have a copy of the branch you wish to test. This is common with wip and release branches. This step is not required if you plan to test the dev branch.

  1. Login to GitHub and go to your cgm-remote-monitor repository.
  2. Switch to your dev branch
  3. Create a new branch based on dev, using the same name as the branch you wish to test.

Create Branch 1

Create Branch 2

Create Branch 3

Update your test branch

Use the Update Fork Tool to update your test branch. The process is the same as above for updating your dev branch. This step is not required if you plan to test the dev branch.

Deploy your test website

Deploy your test website to Azure, Heroku, or a local install if you prefer.

Website Setup Examples

Here are a couple of deployment examples.

  • Deploy site to Azure, Heroku, or local, use the Mongo URI and collection from your main website. Setup the test site variables the same as your main site. This works well for testing all UI features including Care Portal with your live data.
  • Deploy new site to Heroku, adding a REST upload URL to your uploader device. This keeps the website completely separate from your live Care Portal data.