hello / suripu

Suripu スリープ tracks data collected by sensors during sleep.
26 stars 7 forks source link

Templating engine for config files #1215

Open jakepic1 opened 8 years ago

jakepic1 commented 8 years ago

Copy-pasting from one configuration file to another for each environment (especially local dev files) is painful and error-prone. Many good templating engines exist that we could use as part of our build/commit process to reduce duplication of things like database names, URLs, etc.

jakepic1 commented 8 years ago

A simple proposed solution:

  1. Use an easy templating engine like mustache. It's flexible without having way too many features or being tied to a particular programming language or environment.
  2. Rather than attempting to automatically generate the rendered YAML files at build-time, we can have a semi-manual process (i.e. running a script like ./generate_configs or similar). This would then generate the necessary "compiled" config files in their appropriate directories.
  3. Commit the compiled config files to Git, but prefer never to modify these compiled files, only the templates. This is similar to our current process for generating Java source code from Protobuf.