Scaffold environments from component.json file
It's somewhat tedious to have to guess, and often re-guess as to the correct nesting structure of the yaml/json that is consumed by fab generate. If my component.json consumes stacks which are consumed themselves of a number of number of components, then we end up with a deeply nested structure that looks like:
config:
subcomponents:
my-cool-stack:
config:
subcomponents:
component1:
config:
key: value
component2:
config:
foo: bar
proposal: a fab scaffold my-new-environment command that will generate a yaml/json file within the "config" directory, enumerating the subcomponents defined by component.json, and automatically insert an empty subcomponent configuration into the yaml/json file.
- start with a component.json
name: "test-stack"
subcomponents:
- name: "elasticsearch-fluentd-kibana"
source: "https://github.com/timfpark/fabrikate-elasticsearch-fluentd-kibana"
method: "git"
- name: "prometheus-grafana"
source: "https://github.com/timfpark/fabrikate-prometheus-grafana"
method: "git"
-
user runs
fab scaffold cool-stack -
fabrikate generates an empty file, cool-stack.yaml in "generated", that contains the subcomponents (OT: should this iterate over subcomponents' subcomponents as well?):
config:
subcomponents:
elasticsearch-fluentd-kibana:
config: {}
subcomponents: {}
prometheus-grafana:
config: {}
subcomponents: {}
fab add works towards this by automatically scaffolding out components that don't yet exist. We could add a fab init for creating a component but not adding anything to it. What else is necessary for a spanning set of functionality?