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

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 (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


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:


  • Item 1
  • Item 2
  • Item3

0 voters