From f78257cbddd711e18cbce93ad740a4aa0acac347 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 6 Mar 2020 15:08:05 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- doc/ci/yaml/README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'doc/ci/yaml') diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index 00b5d5d0d6d..9976a423996 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -158,6 +158,42 @@ rspec 2.6: script: bundle exec rspec ``` +### `inherit` + +> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/207484) in GitLab 12.9. + +You can disable inheritance of globally defined defaults +and variables with the `inherit:` parameter. + +In the example below: + +- `rubocop` **will** inherit both the `before_script` and the variable `DOMAIN`. +- `rspec` **will not** inherit the `before_script` or the variable `DOMAIN`. +- `capybara` **will** inherit the `before_script`, but **will not** inherit the variable `DOMAIN`. + +```yaml +default: + before_script: + - echo Hello World + +variables: + DOMAIN: example.com + +rubocop: + script: bundle exec rubocop + +rspec: + inherit: + default: false + variables: false + script: bundle exec rspec + +capybara: + inherit: + variables: false + script: bundle exec capybara +``` + ## Parameter details The following are detailed explanations for parameters used to configure CI/CD pipelines. -- cgit v1.2.3