Closed dotchev closed 6 years ago
@dotchev support for VCAP_SERVICES definitely sounds like a good idea to me. A PR would be great!
As a (really ugly) workaround in the meantime, you should be able to do this now by cramming it on to one line:
SOME_VAR=foo
VCAP_SERICES={"elephantsql":[{"name": "elephantsql-c6c60","credentials":{"uri":"postgres://seilbmbd:ABcdEF@babar.elephantsql.com:5432/seilbmbd"}}]}
Meanwhile I started a new project https://github.com/dotchev/fireup. It is similar to Foreman but uses a single yml file to describe multiple processes to start, each with its own env vars, work dir, etc. YAML is very flexible and allows for multi-line values using block literals.
VCAP_SERVICES: >
{
"elephantsql": [
{
"name": "elephantsql-c6c60",
"label": "elephantsql",
"tags": [
"postgres",
"postgresql",
"relational"
],
"plan": "turtle",
"credentials": {
"uri": "postgres://seilbmbd:ABcdEF@babar.elephantsql.com:5432/seilbmbd"
}
}
]
}
Need multiline support as well. Some configuration such as certificate or private key are multiline. I haven't dig into the source but node foreman seems to take \n as \n instead of newline.
Ruby foreman support multiline with "\n" in the config string. https://github.com/ddollar/foreman/blob/master/lib/foreman/env.rb
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
For production we deploy to Cloud Foundry, but for local testing I think node-foreman could be very useful.
One thing I currently miss is the support for multiline env variables as these are heavily used in Cloud Foundry, e.g. VCAP_SERVICES
I think this will be easy to achieve by providing an option to disable JSON flattening of .env file. Instead the value of each root-level property is stringified.
Would you accept a PR for this?