Consice, Reusable and Refactored Definitions
25%
When Data is Merged vs Replaced?
We have seen an example that shows how Gitlab merges a section from the base configuration with the section that extends it + overrides the redefined keys. This process is a merge operation. Let's take this example as a reminder:
.base:
variables:
VAR1: "value1"
VAR2: "value2"
job:
extends: .base
variables:
VAR1: "new_value1"
The resulting job will look like this:
job:
variables:
VAR1: "new_value1"
VAR2: "value2"
However, there's a trap when it comes to lists. Here is an example:
.base:
script:
- echo "command1"Cloud Native CI/CD with GitLab
From Commit to Production ReadyEnroll now to unlock all content and receive all future updates for free.
