ddollar / foreman

Manage Procfile-based applications

Home Page:http://ddollar.github.com/foreman

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Read environment variables directly from CLI command

ecbrodie opened this issue · comments

It would be nice if Foreman supported passing environment variables through the Procfile to the associated commands directly from the CLI command, instead of requiring all environment variable to be specified in the .env file. The current approach is quite limited, while my proposed approach allows for a lot of flexibility that most runner apps similar to Foreman allow for.

For example, if I wanted to ad-hoc pass the variable FOO_BAR=1 to my Procfile-based app and not want to export the variable, then I would love to just enter in this command:

FOO_BAR=1 foreman start

@ddollar if this behaviour doesn't exist right now in Foreman (which I personally doubt it does), would you be welcoming to a PR that introduces this functionality? Having support for this will simplify some use cases for the application that I work on, thus giving me motivation to contribute.

@ecbrodie is this still an issue?

@ecbrodie: check env command, you can have something like
env MY_VAR=1 command --arg=1
env run command in modified environment which is convenient workaround for what you are asking I guess.