Change tracking branch for your Discourse instance

(Arpit Jalan) #1

We do not recommend tracking master branch for your Discourse instance, because master branch is usually bleeding edge or unstable. In this guide we’ll describe how to change tracking branch for your Discourse instance to tests-passed. Let’s get started!

Open configuration file app.yml. From console, run these commands:

cd /var/discourse
git pull
nano containers/app.yml

Configuration file will open in nano editor. Search for version (with Ctrl+W) in the file:

  ## Which Git revision should this container use?
  version: HEAD

Replace HEAD with tests-passed:

  ## Which Git revision should this container use?
  version: tests-passed

After completing your edits, press Ctrl+O then Enter to save and Ctrl+X to exit.

Rebuild the container:

git pull
./launcher rebuild app

That’s it! Your Discourse instance is tracking tests-passed branch now!

Discourse update Permission denied
Upgrade Button - Possible Window to Exploits
Cannot reorder categories
Change right gutter to vertical timeline + topic controls
Is it possible to upgrade Discourse up to a number of commits in the version?
Download My Posts failed
Require password for trusted user invites
Help us test the rewritten Composer
phpBB conversion and general (Linux / Docker / Ruby / GEMs) help
Should we upgrade to each new beta?
Tracking Branch in the email
(Greg Swallow) #2

So why is “tests-passed” not the default then?

(Michael Downey) #3

Are you sure about this? In the following thread, it was suggested that we’re all getting the tests-passed branch, which would explain why I didn’t get commits in master just after they were merged. My app.yml file has the version: HEAD param.

My config says HEAD but I’m pretty sure I’m actually getting tests-passed when I update via /admin/docker.

(Jeff Atwood) #4

It is the default, now. It was not the default in the past.

(Arpit Jalan) #5

“tests-passed” branch is not default, as of now. PR for it:

(Sam Saffron) #6

I corrected this, needed to be fixed in a bunch of other spots.

(Michael Downey) #7

OK, I’m confused. :slight_smile: Should everyone be changing their app.yml to version: tests-passed or should we wait for it to be updated for us?

(Arpit Jalan) #8

The discourse_docker image is recently updated. I recommend you to follow above steps, and you will be on latest discourse_docker image, with your tracking branch as tests-passed.

(Sam Saffron) #9

I can’t do this automatically.

If your config file says: version: HEAD we will update you to the HEAD of the master branch, which is untested.

Change it to version: tests-passed

(Michael Downey) #10

I changed this as described above (as root). However, when I run the docker web upgrade, it now starts as follows:

$ cd /var/www/discourse && git fetch && git reset --hard HEAD@{upstream}
warning: unable to access '/root/.config/git/attributes': Permission denied
HEAD is now at 18f5751 BUGFIX: cap image widths in usercards & user profiles

Does that seem right? How can I verify what branch the Docker upgrade app is using?

(Lee_Ars) #11

Am seeing the same permission denied error.

(Sam Saffron) #12

The permission denied issue benign and I will get it fixed in the next image. cc @supermathie (in the list of things we need for our v1 image)

Discourse update Permission denied
(Tuan Anh Tran) #13

will this be fixed automatically by upgrading docker manager in v1.0 release ?

(Sam Saffron) #14

It will be fixed automatically with a ./launcher rebuild when the image is ready.

(Tuan Anh Tran) #15

Is anyone here riding on master? How unstable(stable) is it?

(Kane York) #16

tests-passed only trails master by 5 minutes or so. The whole point is so that if someone accidentally pushes broken code that fails tests, nobody will get that bad code running on their instance.

(Florian Beer) #17

I attempted to change to the new branch but wasn’t successful. It seems it need postgres 9.2 but only version 9.1 is available as a packet for Ubuntu 13.10

The error message I got was:


You are going to need to export your data and import into a clean instance:

Add the line: base_image: "samsaffron/discourse:0.1.1"
Change: templates/postgres.template.yml TO templates/postgres.9.2.template.yml

Run ./launcher bootstrap again

When your instance is running:

  • Go to the admin UI, enable readonly and backup your site

Then destroy your container ./launcher destroy standalone
Undo the base_image and postgres.9.2 template from your container config
Run: sudo mv /var/docker/shared/postgres_data /var/shared/postgres_data_old
Run: ./launcher bootstrap

Login to the blank site, and import your backup (remember to set the allow_restore site setting)
Restart your container: ./launcher restart

At first I was confused as to where to add the line base_image: "samsaffron/discourse:0.1.1" but then figured out that it needs to be added to my containers/app.yml file. After trying ./launcher bootstrap app then, it failed with the following:

I, [2014-07-12T11:07:22.569642 #40]  INFO -- : > chown -R root /var/lib/postgresql/9.3/main
chown: cannot access `/var/lib/postgresql/9.3/main': No such file or directory
/pups/lib/pups/exec_command.rb:85:in `spawn': chown -R root /var/lib/postgresql/9.3/main failed with return #<Process::Status: pid 105 exit 1> (RuntimeError)
from /pups/lib/pups/exec_command.rb:55:in `block in run'
from /pups/lib/pups/exec_command.rb:53:in `each'
from /pups/lib/pups/exec_command.rb:53:in `run'
from /pups/lib/pups/command.rb:6:in `run'
from /pups/lib/pups/config.rb:85:in `block (2 levels) in run_commands'
from /pups/lib/pups/config.rb:76:in `each'
from /pups/lib/pups/config.rb:76:in `block in run_commands'
from /pups/lib/pups/config.rb:75:in `each'
from /pups/lib/pups/config.rb:75:in `run_commands'
from /pups/lib/pups/config.rb:71:in `run'
from /pups/lib/pups/cli.rb:31:in `run'
from /pups/bin/pups:8:in `<main>'

I could re-start the old version with ./launcher start app and it is up and running now, but I’m afraid I lost the ability to upgrade via admin/docker. Is it worth it to try and install postgres 9.2 on my system?

(Sam Saffron) #19

Can you back up your instance? If so create a backup, then start a brand new container and import into it.

(Florian Beer) #20

I will try thanks, but what about the apparent postgres 9.2 dependency?

(Sam Saffron) #21

Our latest image is postgres 9.3, but you can restore a pg 9.1 backup of discourse on top of a blank image.