Feature Request: ability to put comments in Procfiles
I'd like to add comments to my Procfile, I tried starting a line with "#" but it complained and failed to boot.
Comments would be great for documentation for team projects.
For now I'd like to leave the Procfile as simple as possible to be easily parseable. Thanks for the feedback!
I need this ability too :), will be very usefull for documenting things for the project.
diff --git a/lib/foreman/engine.rb b/lib/foreman/engine.rb
index b624986..21df7d9 100644
--- a/lib/foreman/engine.rb
+++ b/lib/foreman/engine.rb
@@ -29,6 +29,7 @@ class Foreman::Engine
@processes ||= begin
@order = []
procfile.split("\n").inject({}) do |hash, line|
+ next hash if line =~ /^#/
next hash if line.strip == ""
name, command = line.split(/\s*:\s+/, 2)
unless command
I also need an ability to quickly enable/disable some things in development env. + 1 to t0d0r
Same. This would be super handy.
I'd like this too.
There is a problem with resque where we have to modify the normal startup of the worker. It would be great to document this change with a link to the existing resque problem.
Agree, this would be extremely useful. "as simple as possible but no simpler". Cheers
as a counterpoint - for development i have a Procfile.dev which runs extra tasks like compiling coffeescript (not a rails app) and running the app with shotgun not rackup. Could you try that instead? the -f option on foreman allows you to specify a different Procfile...
The pattern I like to use for these cases is bin/ scripts:
$ cat Procfile
web: bin/web
$ cat bin/web
#!/bin/sh
if [ "$RACK_ENV" == "development" ]; then
shotgun start -p $PORT
else
thin start -p $PORT
fi
This keeps the Procfile simple, and should always allow you to start your app using bin/web
ah, that makes sense too, if it weren't for the extra tasks
For what it's worth, the Procfile parser now only tries to parse lines that match a certain regex, so comments will likely work.
+1 for comments
+1
+1 for comments
:+1:
+1 for comments too.
This is trivial to implement. In fact, I think that someone demonstrated a one-line change that would do the simplest version of it above. I'd submit a PR myself, but will it be accepted?
A file without comments like is a car without doors. Sure, you can get in through the window, Dukes-of-Hazard-style, but... why?
I thought the same thing. I'd be happy to implement it you, @odigity, can't. And with approval from the makers.
+1 for comments
I'm also in favour of this issue being reopened. The suggested workaround doesn't allow you to make a general comment about the Procfile, since the comments would go in the specific shell scripts.
I'm in favor of reopening this as well. Commenting in the procfile during development would allow users to easily test different configurations during development.