Giter Site home page Giter Site logo

Comments (36)

ddollar avatar ddollar commented on June 11, 2024

For now I'd like to leave the Procfile as simple as possible to be easily parseable. Thanks for the feedback!

from foreman.

t0d0r avatar t0d0r commented on June 11, 2024

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.

denmarkin avatar denmarkin commented on June 11, 2024

I also need an ability to quickly enable/disable some things in development env. + 1 to t0d0r

from foreman.

pguillory avatar pguillory commented on June 11, 2024

Same. This would be super handy.

from foreman.

alan avatar alan commented on June 11, 2024

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.

christianl avatar christianl commented on June 11, 2024

Agree, this would be extremely useful. "as simple as possible but no simpler". Cheers

from foreman.

lenary avatar lenary commented on June 11, 2024

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.

ddollar avatar ddollar commented on June 11, 2024

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.

lenary avatar lenary commented on June 11, 2024

ah, that makes sense too, if it weren't for the extra tasks

from foreman.

ddollar avatar ddollar commented on June 11, 2024

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.

odigity avatar odigity commented on June 11, 2024

+1 for comments

from foreman.

stationkeeping avatar stationkeeping commented on June 11, 2024

+1

from foreman.

mariusbutuc avatar mariusbutuc commented on June 11, 2024

+1 for comments

from foreman.

WattsInABox avatar WattsInABox commented on June 11, 2024

👍

from foreman.

gueyeb avatar gueyeb commented on June 11, 2024

+1 for comments too.

from foreman.

odigity avatar odigity commented on June 11, 2024

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.

WattsInABox avatar WattsInABox commented on June 11, 2024

I thought the same thing. I'd be happy to implement it you, @odigity, can't. And with approval from the makers.

from foreman.

macool avatar macool commented on June 11, 2024

+1 for comments

from foreman.

dideler avatar dideler commented on June 11, 2024

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.

joshnroy avatar joshnroy commented on June 11, 2024

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.

cjroebuck avatar cjroebuck commented on June 11, 2024

+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.

Matt-- avatar Matt-- commented on June 11, 2024

+1 for comments

from foreman.

ericraio avatar ericraio commented on June 11, 2024

+1 for comments

from foreman.

beornborn avatar beornborn commented on June 11, 2024

+1 for comments

from foreman.

marksterxxx avatar marksterxxx commented on June 11, 2024

+1 for comments

from foreman.

adis-io avatar adis-io commented on June 11, 2024

+1 for comments

from foreman.

reconstructions avatar reconstructions commented on June 11, 2024

+1 for comments

from foreman.

diziet avatar diziet commented on June 11, 2024

+1, especially as we want to have a Profile.example that folks can use easily

from foreman.

ddollar avatar ddollar commented on June 11, 2024

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.

diziet avatar diziet commented on June 11, 2024

@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.

WattsInABox avatar WattsInABox commented on June 11, 2024

I swear I tried it at some point and it didn't work, but it's totally working now. Thanks, guys.

from foreman.

jwfearn avatar jwfearn commented on June 11, 2024

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.

mitchellporter avatar mitchellporter commented on June 11, 2024

+1 for comments

from foreman.

benzittlau avatar benzittlau commented on June 11, 2024

+1 for comments

from foreman.

RawStewage avatar RawStewage commented on June 11, 2024

+1 for comments

from foreman.

jpwynn avatar jpwynn commented on June 11, 2024

It's a file.

+1 for DOCUMENTING the format for a comment...

from foreman.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.