basho / cuttlefish

never lose your childlike sense of wonder baby cuttlefish, promise me?
Apache License 2.0
205 stars 124 forks source link

Environment Variables #135

Open joedevivo opened 10 years ago

joedevivo commented 10 years ago

It might be useful to teach Cuttlefish about Environment Variables. That could be in the form of defaults and having a syntax that subs Env vars in the right hand side, the same way we do substitutions.

Maybe something like some.setting = $[SOME_ENV_VAR], which could also be used in a mapping's default attribute. Although, we may want to avoid doing them in defaults and have an explicit default, and then have another mapping attribute for env_var that understands the logic "pull the default form this env var, but if it's not defined, use the value from default"

h/t @ferd for the idea.

ferd commented 10 years ago

You can take a look at stillir for Heroku's far less complete solution to handle configuration from ENV variables.

But yeah, ENV variables are neat because you separate the configuration task from the environment it's running in, and the same values are often needed for multiple applications (or agents) running in similar setups.

Cuttlefish having some support for that could be pretty sweet.