Consice, Reusable and Refactored Definitions
24%
Overriding Extended Configurations
In more advanced use cases, extended configurations can be overridden. For example, we want to have a test3 job that uses the same configuration as test1 but runs different scripts in the before_script section. Here is how we can do it:
cat <$HOME/todo/app/.gitlab-ci.yml
stages:
- test
include:
- local: '.includes/base_test.yml'
test1:
extends: .base_test
script:
- echo "Running tests for test1..."
test2:
extends: .base_test
script:
- echo "Running tests for test2..."
test3:Cloud Native CI/CD with GitLab
From Commit to Production ReadyEnroll now to unlock all content and receive all future updates for free.
