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

Latest commit

 

History

History
137 lines (102 loc) · 4.99 KB

continuous-deployment.md

File metadata and controls

137 lines (102 loc) · 4.99 KB
HomeContinuous Deployment

Continuous Deployment

Use this strategy for projects where features get deployed as soon as they're ready.

We follow the GitHub flow workflow as closely as possible. This page showcases common development scenarios and how to deal with them from a branching point of view.

Branches Overview

Github flow workflow

Branch Protected? Base Branch Description
main YES N/A What is live in production (stable).
A pull request is required to merge code into main.
feature NO main Cutting-edge features (unstable). These branches are used for any maintenance features / active development.
hotfix-* NO main These are bug fixes against production.

Develop a new feature

Hotfix use rarely

  1. Create a feature branch based off of main.

    $ git checkout main
    $ git checkout -b MYTEAM-123-new-documentation
    $ git push --set-upstream MYTEAM-123-new-documentation
    
  2. Develop the code for the new feature and commit as you go.

    $ ... make changes
    $ git add -A .
    $ git commit -m "Add new documentation files"
    $ ... make more changes
    $ git add -A .
    $ git commit -m "Fix some spelling errors"
    $ git push
    
  3. Navigate to the project on Github and open a pull request with the following branch settings:

    • Base: main
    • Compare: MYTEAM-123-new-documentation
  4. When the pull request has been reviewed and +1'd , merge and close it and then delete the MYTEAM-123-new-documentation branch. This can all be done from the Github pull-request page.

  5. Deploy main to a staging environment to verify (some teams have this automated, some prefer a manual deploy with some conventions, either is fine).

  6. If everything is good in staging, promote it to production and you're done. If not, roll back production to the previous release and return to Step 1.

Develop multiple features in parallel

There's nothing special about that. Each developer follows the above Develop a new feature process.

During development, make sure to update from main often so that when you get ready to complete your feature you don't have to deal with large code conflicts.

Production hot fix

In rare situations you may need to get a fix into production fast! Use this workflow to push a hotfix to production when you can't spare the time to follow the standard 'Develop a feature' workflow.

Hotfix use rarely

This is very similar to how we Develop a new feature described above.

  1. Make sure your main branch is up-to-date

    $ git checkout main
    $ git fetch
    $ git merge origin/main
    
  2. Create a hot fix branch based off of main

    $ git checkout -b hotfix-documentation-broken-links
    $ git push --set-upstream hotfix-documentation-broken-links
    
  3. Add a test case to validate the bug, fix the bug, and commit When doing a hotfix you should at least pair on the fix with somebody or review it in person with one other engineer before releasing it. We're running without training wheels here and want to do our best not to have to do a stream of hotfixes in production.

    ... add test, fix bug, verify
    $ git add -A .
    $ git commit -m "Fix broken links"
    $ git push
    
  4. Navigate to the project on Github and open a pull request with the following branch settings:

    • Base: main
    • Compare: hotfix-documentation-broken-links
  5. When the pull request has been reviewed and +1'd , merge and close it and then delete the hotfix-documentation-broken-links branch. This can all be done from the Github pull-request page.

Develop in a platform repo

A platform repo contains both Progressive Mobile App and Progressive Mobile Web source code.

The development process is the same as outlined above in Develop a new feature.

However, branches have to be prefixed based on the following rules:

  • app-, for changes mainly touching Progressive Mobile App code.
  • web-, for changes mainly touching Progressive Mobile Web code.
  • platform-, for changes touching both Progressive Mobile App and Web code.