-
Notifications
You must be signed in to change notification settings - Fork 12
Description
forjj within Forjfiles and forjj secrets uses a collection of key/value pair and are expanded or used in forjj plugins to generate and deploy services (update/maintain).
Currently forjj works with strings only on the value part of key/value pairs.
In short, in key=value, value is a string only.
In some cases, that string itself can be a json or a yaml format depending of plugin need.
But forjj itself, still consider this data as a raw string and is not interpreted/managed/controlled by forjj.
So, we can introduce a mistake that will break the flow, because the expected string have to be a valid structure which could be extracted as json or yaml string or just extracted piece by piece where needed.
Ex:
key:
key1: value
key2:
- element1
- element2Could be extracted by with go template with such syntax in forjj-jenkins plugin:
{{ .Source.Key | to_json }}
{"key1": "value1", "key2": ["element1", "element2"]}
or
{{ .Source.Key | to_yaml }}
key:
key1: value
key2:
- element1
- element2or
{{ index .Source.Key "key1" }}
values1
We have several other use case, like:
- Validating the structure.
- manage one piece of the structure and not all.
- extract all as an encoded string in json or yaml, or just a single data.