Mixins
Mixins allow to define and reuse parts of jobs in live mode and tasks in batch mode.
To define a mixin, use the top-level mixins
section:
Mixins can define the same properties as "job" and "task" do, except for the "id" field in batch mode. To apply a mixin, use the mixins
property:
When applied, all fields defined in the mixin will be merged into the job definition. You can apply multiple mixins simultaneously. If some of the applied mixins share a property or/and this property is defined in a task, the following rules are applied:
If the property is scalar (int/string/bool), the value from the job definition will be used. If the value is absent in the job definiton, it will be taken from the rightmost of the mixins that define this property.
In this case, job1
will use the example
image and job2
will use the example_mix2
image.
If the property is a list, then all lists will be concatenated.
If the property is a dictionary, the rule for scalar values will be applied to each value from the dictionary.
Mixins can inherit from each other:
Last updated