Recommended approach for production discourse using PR (not merged)

First: I don’t know.

But I think this might work:

cd /var/discourse
./launcher enter app
cd /var/www/discourse
su - discourse -c 'git fetch origin pull/<pr_number>/head:<local_branch_name>'
su - discourse -c 'git switch <local_branch_name>'
sv restart unicorn

If that does work, then you could add stuff to your app.yml to make it do that during the build. Or maybe it’ll get merged soon and you can just wait it out.

If that makes things worse, you can do a

 ./launcher destroy app;./launcher start app

and that’ll put back the image that you last built.

3 Likes