Configuration is loaded from environment variables. Copy env.example to .env and enter the appropriate details.
This app uses resque for async job queueing. You'll need to install redis, run it, and then run a worker to process jobs. On OSX:
brew install redis redis-server & bundle VVERBOSE=1 QUEUE=* rake resque:work
Regular jobs are handled by the resque scheduler, which you can run like so:
QUEUE=* rake resque:scheduler
To get a web interface on your resque workers:
$ foreman start 14:50:10 worker.1 | started with pid 6122 14:50:10 worker.2 | started with pid 6125 14:50:10 worker.3 | started with pid 6128 14:50:10 worker.4 | started with pid 6131 14:50:10 scheduler.1 | started with pid 6137 14:50:10 web.1 | started with pid 6140
It can also export to a set of Upstart scripts:
# foreman export upstart /etc/init [foreman export] writing: resque.conf [foreman export] writing: resque-worker.conf [foreman export] writing: resque-worker-1.conf [foreman export] writing: resque-worker-2.conf [foreman export] writing: resque-worker-3.conf [foreman export] writing: resque-worker-4.conf [foreman export] writing: resque-scheduler.conf [foreman export] writing: resque-scheduler-1.conf [foreman export] writing: resque-web.conf [foreman export] writing: resque-web-1.conf
This picks up some values from the .foreman file. Note that we're using the template at config/foreman/master.conf.erb for the master script because the default start conditions didn't seem to work for me. You can control the whole lot with something like
sudo start resque.
Next step is to proxy the web interface with nginx, but that's an infrastucture thing.
This code is open source under the MIT license. See the LICENSE.md file for full details.