I have a config.yml
that has a number of commands/jobs that accept a parameter specifying the environment against which the job should run. These all define this parameter as an enumeration over the possible environments:
parameters:
environment:
type: enum
enum: ["env-a", "env-b", "env-c", "env-d" ...]
The problem with this approach is that there doesn’t seem to be a way to share the definition of the enumeration type across the various jobs. I’ve wound up with the same enumeration definition repeated again and again throughout the config.yml
file. (Which makes it difficult to reliably edit and all the other assorted problems that are associated with non-“DRY” code.)
My question is whether or not there’s an accepted way within 'standard
config.yml` to reuse this sort of definition? (Maybe a YAML anchor or similar?)