Advanced
Advanced YAML syntax features
Section titled “Advanced YAML syntax features”The YAML language has a number of advanced features that can be used to create complex pipelines. These features include anchors, aliases, and merge keys.
Anchors and Aliases
Section titled “Anchors and Aliases”Anchors and aliases are used to create references to a specific part of the YAML document.
An anchor is created by adding an & followed by a name to the value you want to reference.
An alias is created by adding a * followed by the name of the anchor to the value you want to reference.
Map merges and overrides
Section titled “Map merges and overrides”Map merges are used to merge multiple maps into a single map.
A map merge is created by adding a << followed by a : to the key you want to merge.
The value of the map merge should be a list of maps that will be merged into the map.
Additionally, there is a technique called “sequence merges” which allows for prepending and appending merges to a list.
Persist env vars across steps
Section titled “Persist env vars across steps”To avoid specifying env vars in each step, you can use a dedicated step to initialize them and then source them in subsequent steps.
Here, the envvars name is an arbitrary choice and can be customized to fit your needs.
Rerunning pipeline locally
Section titled “Rerunning pipeline locally”The JSON representation of a pipeline can be downloaded via the API. This allows to rerun the pipeline locally using the CLI. In certain cases this can help in debugging a failed pipeline, for example if issues cannot easily be reproduced.