lumoslabs / txgh

A library for automatically syncing translation resources between Github and Transifex.
1 stars 1 forks source link

Refactor configuration #1

Closed camertron closed 8 years ago

camertron commented 8 years ago

Currently, txgh loads configuration from two locations: config/txgh.yml, which contains a mapping of projects to github repos and a bunch of API secrets, and config/tx.config, which describes which files to process as Transifex resources.

There are a bunch of different strategies that you might use when deploying txgh, and some that don't naturally work well loading files from disk (eg. docker). This PR introduces a breaking change that requires the TX_CONFIG environment variable - which previously pointed to config/tx.config - to include a scheme at the beginning:

  1. file://[path] - load a file from disk. This is the current functionality.
  2. raw://[contents] - load contents directly.
  3. git://[path] - download path from the configured git repository. If per-branch processing is enabled, this will download tx.config from each branch.

I have also moved the structure from txgh.yml into KeyManager since txgh.yml was constructed almost entirely from environment variables, which can be done just as easily in code.

@lumoslabs/platform

jdoconnor commented 8 years ago

+1 with a few comments

st33b commented 8 years ago

:+1: with one comment