https://github.com/elek/envtoconf
Utility for docker container to generate config files from environment variables
https://github.com/elek/envtoconf
Last synced: about 1 year ago
JSON representation
Utility for docker container to generate config files from environment variables
- Host: GitHub
- URL: https://github.com/elek/envtoconf
- Owner: elek
- License: apache-2.0
- Created: 2017-03-28T19:28:14.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-12-13T21:58:06.000Z (over 6 years ago)
- Last Synced: 2025-04-13T16:09:27.162Z (about 1 year ago)
- Language: Go
- Size: 666 KB
- Stars: 3
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Simple go application to generate config files from environment varialbles (key value pairs) based on specific naming convention. Used in docker container to generate the configuration files based on the environment variables.
The environment should be in form:
```
FILENAME.EXT_any.key=value
```
The name of the file (with extension) will be converted to lowercase.
The extracted key value pairs will be transformed to other formats based on the extension.
Supported formats/extensions:
* xml: hadoop xml format
* env, cfg: `key=value` format
* conf, sh: `export key=value` format
* yaml, yml: YAML format. Arrays supported with indexes as `key.value.1: 1` and `key.value.2: 2`
* properties: `key: properties`
* ini: `section.key=value` format converted to:
```
[section]
key=value
```
Optional, the extension and the format could be different with the syntax:
```
FILENAME.EXT!FORMAT_any.key=value
```
With this syntax any filename with extension could be configured with a predefined format.