Template based config generator / settings files merge tool
go get github.com/gojuno/junocfg/...
Modes:
- merge - merge config data from multiply sources to one dataset
- check-tmpl
$ junocfg --merge -i public.yaml,secure.yaml -o settings.yaml
$ junocfg --merge -i public.yaml,secure.yaml > settings.yaml
$ junocfg -t config.yaml.tmpl -i settings.dev.yaml -o config.yaml
$ cat settings.dev.yaml | junocfg -t config.yaml.tmpl > config.yaml
$ junocfg --check-tmpl -t config.yaml.tmpl
$ cat config.yaml.tmpl | junocfg --check-tmpl
merge config data from multiply sources to one dataset and apply it to template
$ junocfg --merge -i public.yaml,secure.yaml | junocfg -t config.yaml.tmpl > config.yaml
echo '{"a":"a","b":["b1","b2","b3","b4"],"c":{"ca":"ca","cb":["cb1","cb2",{"cb3a":"cb3aa"},"cb4",{"cb5a":"cb5aa"}]},"d":"a","e":{"ea":"ea","eb":"eb","ec":"ec"}}' | junocfg --yaml2json | jq '.'
echo '{"a":"a","b":["b1","b2","b3","b4"],"c":{"ca":"ca","cb":["cb1","cb2",{"cb3a":"cb3aa"},"cb4",{"cb5a":"cb5aa"}]},"d":"a","e":{"ea":"ea","eb":"eb","ec":"ec"}}' | junocfg --json2yaml
junocfg --merge -i examples/a.yaml,examples/b.yaml
junocfg --check-tmpl -t examples/c.tmpl
cat examples/c.tmpl | junocfg --check-tmpl
echo '{"a":"a","b":["b1","b2","b3","b4"],"c":{"ca":"ca","cb":["cb1","cb2",{"cb3a":"cb3aa"},"cb4",{"cb5a":"cb5aa"}]},"d":"a","e":{"ea":"ea","eb":"eb","ec":"ec"}}' | junocfg --yaml2json | jq '.' | junocfg --json2yaml