Commit graph

9 commits

Author SHA1 Message Date
Vincent Ambo
3728d0ae2e refactor context: Extract loadJsonOrYaml to util package
The logic to deserialise a structure from *either* JSON or YAML is reused several
times and can be easily extracted, which this commit does.
2017-07-03 14:27:48 +02:00
Vincent Ambo
11cfc80020 feat context: Support resource set default values
This adds functionality to specify default values directly in resource sets.

The idea is that users can create a file called `values.yaml` or `values.json`
in a resource set's folder and have all variables specified in that file be
automatically merged into the resource set variables with the lowest priority.

This fixes #25
This fixes #30 (to a degree)
2017-04-04 20:06:15 +02:00
Vincent Ambo
0147c3e13e feat ctx: Let sub-resource-sets inherit vars from parent
Users of kontemplate may expect variables defined on the parent resource to be
inherited by children.

This implements that functionality. Values defined twice are overwritten by the
child's definition.

Fixes #20
2017-02-14 19:12:53 +01:00
Vincent Ambo
dd2fdd63e5 fix templater & ctx: Correctly check resource set parent 2017-02-08 17:42:06 +01:00
Vincent Ambo
bace4dd895 fix context: Set sub resource names correctly 2017-02-08 17:34:49 +01:00
Vincent Ambo
4e8223ef34 feat context: Add support for resource set collections
A resource set collection is a resource set with an addition 'include' array
configured. It is a short-hand for importing multiple resource sets from the
same folder and for excluding/including them as a group.

See https://github.com/tazjin/kontemplate/issues/9 for more information.

Closes #9
2017-02-08 17:34:49 +01:00
Vincent Ambo
d94a0ffc25 feat context: Add YAML loading support
Closes #5
2017-02-08 13:13:21 +01:00
Vincent Ambo
7ac63613fb feat main: Add proper CLI support
Adds a basic CLI structure with a single "run" command that takes a --file (-f)
and --limit (-l) flag.

--limit can be used to only output certain resource sets.

Closes #4
2017-02-08 12:58:53 +01:00
Vincent Ambo
bb45bfa737 feat context: Add types and loading functions 2017-02-08 11:50:39 +01:00