I just stumbled across the foreman gem (https://github.com/ddollar/foreman)
yesterday, and it could potentially be quite useful for all who run their
own Gitorious installations.

Foreman lets you create a Procfile, a description of which services an
application consists of, and then start and stop all of these with a single
command. On my computer I added a file named Procfile to the root of my
Gitorious installation looking like this:

web:           bundle exec script/server
poller:        bundle exec script/poller run
stompserver:   stompserver

After adding this file, enter the following:
$ gem install foreman
$ foreman start

This will give you a nice output in your terminal, one color for each of the
processes described in the Procfile, and run each of the commands specified
in the file. Once you click Ctrl-C in your terminal, all processes will be
stopped. This makes a lot of sense when developing, saving you from opening
three terminal windows/tabs - one for each process, and then having to
cancel all of them afterwards. If you want to start the git:// protocol
handler, search engine etc as well, it's just a line in your Procfile away.

Furthermore, Foreman supports exporting its configuration to either
sysvinit- or Upstart-style configuration files to let your operating system
take care of your processes instead. This blog post:
http://michaelvanrooijen.com/articles/2011/06/08-managing-and-monitoring-your-ruby-application-with-foreman-and-upstart/
has
more information about this; it could potentially replace a separate
monitoring tool like Monit or God. "Real" system administrators will
probably want a little more control over their Upstart jobs, but it should
make sense in a lot of cases.

I've been pondering whether to add a (sample) Procfile to the Gitorious
source code, or even a Procfile.sample, but I see a few issues with this:
- The deployment strategies people use for Gitorious may not be the same as
my preferences, which is an argument for shipping a default
- Procfiles don't allow comments (yet), which means we can't put
alternatives and documentation in there
- For Foreman to work out of the box, we'd need to add it to the Gemfile,
which doesn't make sense for users who won't be using it

Try it out and let me know what you think!

Cheers,
- Marius

-- 
To post to this group, send email to gitorious@googlegroups.com
To unsubscribe from this group, send email to
gitorious+unsubscr...@googlegroups.com

Reply via email to