Skip to content

Use YAML references instead of YAML anchors for reusable parts of CI

Lennart Karssen requested to merge yaml-reference into development

In recent commits I moved part of the CI deployment script sections to separate YAML blocks marked with YAML anchors so they could be reused. However, it turns out that these anchors only work within a single YAML file. In other words, these anchors could not be reused in projects that use include to load this gitlab-ci.yml file. But that was exactly what I wanted...

This commit updates the CI/CD YAML file to use the !reference keyword to load a part of a YAML template. According to the Gitlab documentation that should work when using include.

Documentation: https://docs.gitlab.com/ee/ci/yaml/yaml_optimization.html#reference-tags and https://docs.gitlab.com/ee/ci/yaml/yaml_optimization.html#anchors

Merge request reports