Ruby foreman

From wikinotes
Revision as of 16:46, 15 April 2021 by Will (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Foreman is a commandline tool that lets you run/coordinate/manage several processes at once.
For example, starting a webserver, database server, and redis all at once.

  • signals repeated to child processes
  • logs are prefixed and colourized to show which process is talking
  • process startup is configurable (say you want to use with 2x workers instead of 1x)


Documentation

github https://github.com/ddollar/foreman
cli interface (docs outdated) https://github.com/ddollar/foreman/blob/master/lib/foreman/cli.rb
procfile docs https://devcenter.heroku.com/articles/procfile

Locations

${PROJECT}/Procfile configure processes that will be started

Usage

foreman start -c ${var1}=foo,${var2}=bar  # colourize, and pass params to Procfile

Configuration