Comments (36)
For now I'd like to leave the Procfile as simple as possible to be easily parseable. Thanks for the feedback!
from foreman.
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
from foreman.
I also need an ability to quickly enable/disable some things in development env. + 1 to t0d0r
from foreman.
Same. This would be super handy.
from foreman.
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.
from foreman.
Agree, this would be extremely useful. "as simple as possible but no simpler". Cheers
from foreman.
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...
from foreman.
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
from foreman.
ah, that makes sense too, if it weren't for the extra tasks
from foreman.
For what it's worth, the Procfile parser now only tries to parse lines that match a certain regex, so comments will likely work.
from foreman.
+1 for comments
from foreman.
+1
from foreman.
+1 for comments
from foreman.
👍
from foreman.
+1 for comments too.
from foreman.
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?
from foreman.
I thought the same thing. I'd be happy to implement it you, @odigity, can't. And with approval from the makers.
from foreman.
+1 for comments
from foreman.
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.
from foreman.
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.
from foreman.
+1 I just want to turn things on and off for dev, but not have to delete the whole line and copy it somewhere else!
from foreman.
+1 for comments
from foreman.
+1 for comments
from foreman.
+1 for comments
from foreman.
+1 for comments
from foreman.
+1 for comments
from foreman.
+1 for comments
from foreman.
+1, especially as we want to have a Profile.example that folks can use easily
from foreman.
Foreman has used a matching filter on the Procfile to only parse lines that look like process entries for a few years now. Are you still running into problems with this?
from foreman.
@ddollar You're correct -- appending # to the beginning of line at the Procfile effectively makes it function like a comment. Sorry for bringing up a nonexistent issue.
from foreman.
I swear I tried it at some point and it didn't work, but it's totally working now. Thanks, guys.
from foreman.
Using foreman 0.82.0 on OS X 10.11.5 and Ruby 2.1.2 I found that lines starting with #
ARE processed, whereas lines starting with //
are ignored. For example this Procfile
:
# foo: cd foo && bundle exec rails s -p 3000
// bar: cd bar && bundle exec rails s -p 3001
baz: cd baz && bundle exec rails s -p 3002
starts two processes: foo
and baz
Would it be possible to add true comments rather than a parser-matching-filter to recognize lines that look like process entries?
If so, please also update docs to indicate how comments work (e.g., comment string: #, //, or other?, whole lines only?, end of line only?, multi-line? __END__
? etc.)
from foreman.
+1 for comments
from foreman.
+1 for comments
from foreman.
+1 for comments
from foreman.
It's a file.
+1 for DOCUMENTING the format for a comment...
from foreman.
Related Issues (20)
- Odd error message when you skip the 'start' command and include a -f
- Using RuboCop?
- issue killing subprocesses using `cd` with failure at startup HOT 1
- breakpoint vscode not work to Ruby
- After the foreman finishes, the ruby process continues to exist HOT 2
- Release 1.0? HOT 1
- About link is broken HOT 1
- Foreman does not terminate child process HOT 3
- Forman doesn't show errors and logs of Procfile commands HOT 3
- Change https://ddollar.github.com/foreman to https://ddollar.github.io/foreman on repo description link
- Port 5000 taken by Mac OSX HOT 1
- When launching rails via foreman, rails asset pipeline errors
- Support for x64-mingw-ucrt platform
- Version Optimize
- Document that Foreman secretly sets the PORT environment variable to 5000 HOT 1
- Error after running command "foreman start"
- foreman export systemd raises undefined method `exists?' for File:Class (NoMethodError) HOT 1
- Security CVE-2022-3874 HOT 4
- Usage Error: Unrecognized or legacy configuration settings found
- Ruby32-x64/lib/ruby/gems/3.2.0/gems/foreman-0.87.2/lib/foreman/engine.rb:201:in `kill': Invalid argument (Errno::EINVAL)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from foreman.