diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-08-29 09:35:19 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-08-29 09:35:19 +0200 |
commit | 173e0a7c7cc1a6f81f3ef3e9395051ca11294a4e (patch) | |
tree | f09fe75f88b058e643230ff9fdae4a7aa249f24c /doc/ci | |
parent | 2991f93f2fdd2b6de2b307ee5ba8d8ac6651f845 (diff) | |
download | gitlab-ce-173e0a7c7cc1a6f81f3ef3e9395051ca11294a4e.tar.gz |
Update documentation about hidden keys in CI YAML
Diffstat (limited to 'doc/ci')
-rw-r--r-- | doc/ci/yaml/README.md | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index e7850aa2c9d..58d5306f12a 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -39,7 +39,7 @@ If you want a quick introduction to GitLab CI, follow our - [before_script and after_script](#before_script-and-after_script) - [Git Strategy](#git-strategy) - [Shallow cloning](#shallow-cloning) -- [Hidden jobs](#hidden-jobs) +- [Hidden keys](#hidden-keys) - [Special YAML features](#special-yaml-features) - [Anchors](#anchors) - [Validate the .gitlab-ci.yml](#validate-the-gitlab-ci-yml) @@ -934,24 +934,27 @@ variables: GIT_DEPTH: "3" ``` -## Hidden jobs +## Hidden keys >**Note:** Introduced in GitLab 8.6 and GitLab Runner v1.1.1. -Jobs that start with a dot (`.`) will be not processed by GitLab CI. You can +Keys that start with a dot (`.`) will be not processed by GitLab CI. You can use this feature to ignore jobs, or use the -[special YAML features](#special-yaml-features) and transform the hidden jobs +[special YAML features](#special-yaml-features) and transform the hidden keys into templates. -In the following example, `.job_name` will be ignored: +In the following example, `.key_name` will be ignored: ```yaml -.job_name: +.key_name: script: - rake spec ``` +Hidden keys can be hashes like normal CI jobs, but you are also allowed to use +different types of structures to leverage special YAML features. + ## Special YAML features It's possible to use special YAML features like anchors (`&`), aliases (`*`) @@ -967,7 +970,7 @@ Introduced in GitLab 8.6 and GitLab Runner v1.1.1. YAML also has a handy feature called 'anchors', which let you easily duplicate content across your document. Anchors can be used to duplicate/inherit -properties, and is a perfect example to be used with [hidden jobs](#hidden-jobs) +properties, and is a perfect example to be used with [hidden keys](#hidden-keys) to provide templates for your jobs. The following example uses anchors and map merging. It will create two jobs, @@ -975,7 +978,7 @@ The following example uses anchors and map merging. It will create two jobs, having their own custom `script` defined: ```yaml -.job_template: &job_definition # Hidden job that defines an anchor named 'job_definition' +.job_template: &job_definition # Hidden key that defines an anchor named 'job_definition' image: ruby:2.1 services: - postgres @@ -1081,7 +1084,7 @@ test:mysql: - ruby ``` -You can see that the hidden jobs are conveniently used as templates. +You can see that the hidden keys are conveniently used as templates. ## Validate the .gitlab-ci.yml |