I’ve put together what I believe to be the simplest way of deploying Discourse yet using Rubber.
First, some background on Rubber. Rubber is a capistrano extension that keeps all configuration within your codebase and manages tasks by what roles a server has similar to Chef/Puppet etc.
It’s advantages are:
- All config is within your codebase and configurable using ERB within the configs
- It’s abstraction simplifies the process enough so that you get down to two commands to setup and one command to update.
rubber vulcanize discourseand
cap rubber:create_stagingto start
cap deployto update
But it also allows complete configurablility to scale to a full production architecture
- Utilizes cloud providers such as AWS, Rackspace, Digital Ocean or your own generic ubuntu box
- Been used in production by many companies for years
Advantages for Discourse:
- Separates application code and ops code
- The Discourse team can update the Rubber template with the best
options and rubber will handle the upgrading without having to check
- Replaces BluePill for process management
- Custom Discourse infrastructure tasks can be written into Rubber for easy customer use
I’m hoping to get it down to 3 lines:
gem install rubber
rubber vulcanize discourse
- edit minimal config for your provider
It’s still a little rough so I’d appreciate some feedback.
Edit: Adding the contents of the gist to be discussed here.
git clone https://github.com/discourse/discourse.git
echo "gem 'rubber', github: 'ScotterC/rubber', branch: 'discourse'" >> Gemfile
rubber vulcanize discourse reply with n to overwrite questions
key_name and key_file # => Requires EC2 keypair
Other Providers see:
Remove duplicate ‘rubber’ line from Gemfile
cp redis.yml.sample redis.yml
cp environments/production.rb.sample environments/production.rb
hit return for hostname prompt
hit return for roles if they mimic above staging roles
computer password for access to /etc/hosts
if it fails with
vboxadd: unrecognized service. Make sure you’re not using Capistrano 2.15.5. Comment out
reinstall_virtualbox_additions task in rubber/deploy-setup.rb and run
cap rubber:bootstrap && cap deploy:migrations
When create_staging finishes. In your browser
production.discourse.com should be a discourse site