Applying a patch to a customer site

Sometimes we might need to deploy a patch to our hosted sites before making the change public on GitHub. For example, when we find a serious security vulnerability. To do this:

  1. Obtain a diff of the change. There are many ways to do this, here is one way:

    • Make a commit to a local branch of the discourse repository (DO NOT PUSH TO ORIGIN)

    • git format-patch -1 <sha> (where <sha> is the hash of your commit)

  2. Commit the file to https://github.com/discourse-org/hosted-site/tree/master/patches

SJC Datacentres :desktop_computer:

  1. Run the build-discourse job, to ensure the base image has the latest version of hosted-site

  2. Add a patch command to staging_web.yml, on a line after hosted-site is installed (example commit)

    - patch -p1 < plugins/hosted-site/patches/2018-08-28-custom_field_fix.diff
    
  3. Deploy all sites in all datacentres

Cloud :cloud:

  1. Add a patch line to the config file for each site you want to patch in https://github.com/discourse-org/cloud-hosting. (Example commit)

    Note: at the time of writing these files are slightly different, so you will need to include a cd command before running patch. For example:

    - cd $home && patch -p1 < plugins/hosted-site/patches/2018-08-28-custom_field_fix.diff
    
  2. Deploy all the sites

Finally

Once the patch has been made public, revert the changes to docker_hosting, cloud-hosting, and hosted-site, to keep things nice and tidy :broom:

https://lets.trydiscourse.com/session/email-login/0de4c3500bd1516fea50c34744ae81ac
https://lets.trydiscourse.com/session/email-login/0de4c3500bd1516fea50c34744ae81ac
https://lets.trydiscourse.com/session/email-login/0de4c3500bd1516fea50c34744ae81ac

5ddbea87fd9db26feb27cee2

  • Item 1
  • Item 2
  • Item3

0 voters